HEX
Server: LiteSpeed
System: Linux emerald.serverdnsnetwork.com 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: mahdetej (1135)
PHP: 8.1.34
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open
Upload Files
File: /home/mahdetej/public_html/wp-content/plugins/admin-menu-editor/customizables/Controls/TextArea.php
<?php

namespace YahnisElsts\AdminMenuEditor\Customizable\Controls;

use YahnisElsts\AdminMenuEditor\Customizable\Rendering\Context;
use YahnisElsts\AdminMenuEditor\Customizable\Rendering\Renderer;
use YahnisElsts\AdminMenuEditor\Customizable\Settings\StringSetting;

class TextArea extends ClassicControl {
	protected $type = 'textarea';

	/**
	 * @var Binding
	 */
	protected $mainBinding;

	protected $rows = 5;
	protected $cols = 100;

	public function __construct($settings = array(), $params = array(), $children = []) {
		$this->hasPrimaryInput = true;
		parent::__construct($settings, $params, $children);

		if ( isset($params['rows']) ) {
			$this->rows = max(intval($params['rows']), 1);
		}
		if ( isset($params['cols']) ) {
			$this->cols = max(intval($params['cols']), 1);
		}
	}

	public function renderContent(Renderer $renderer, Context $context) {
		$value = (string)$context->resolveValue($this->mainBinding);

		//phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped -- builtInputElement() is safe
		echo $this->buildInputElement(
			$context, [
			'rows'      => (int)$this->rows,
			'cols'      => (int)$this->cols,
			'class'     => 'large-text',
			'data-bind' => $this->makeKoDataBind([
				'value' => $this->getKoObservableExpression($value),
			]),
		],
			'textarea',
			esc_textarea($value)
		);
		//phpcs:enable
		$this->outputSiblingDescription();
	}
}