Current File : /home/resuelf/www/wp-content/plugins/auto-post-thumbnail/libs/factory/forms/controls/hidden.php
<?php

	/**
	 * Hidden Input Control
	 *
	 * Main options:
	 *  name            => a name of the control
	 *  value           => a value to show in the control
	 *  default         => a default value of the control if the "value" option is not specified
	 *
	 * @author Alex Kovalev <[email protected]>
	 * @copyright (c) 2018, Webcraftic Ltd
	 *
	 * @package factory-forms
	 * @since 1.0.0
	 */

	// Exit if accessed directly
	if( !defined('ABSPATH') ) {
		exit;
	}

	if( !class_exists('Wbcr_FactoryForms463_HiddenControl') ) {

		class Wbcr_FactoryForms463_HiddenControl extends Wbcr_FactoryForms463_Control {

			public $type = 'hidden';

			/**
			 * Shows the html markup of the control.
			 *
			 * @since 1.0.0
			 * @return void
			 */
			public function html()
			{
				$value = esc_attr($this->getValue());
				$name_on_form = $this->getNameOnForm();

				$this->addHtmlAttr('id', $name_on_form);
				$this->addHtmlAttr('name', $name_on_form);
				$this->addHtmlAttr('value', $value);
				$this->addHtmlAttr('type', 'hidden');

				?>
				<input <?php $this->attrs() ?>/>
			<?php
			}
		}
	}