customs
5 months ago
holders
5 months ago
checkbox.php
5 months ago
color-and-opacity.php
5 months ago
color.php
5 months ago
datepicker-range.php
5 months ago
dropdown-and-colors.php
5 months ago
dropdown.php
5 months ago
font.php
5 months ago
google-font.php
5 months ago
gradient.php
5 months ago
hidden.php
5 months ago
index.php
5 months ago
integer.php
5 months ago
list.php
5 months ago
multiple-textbox.php
5 months ago
paddings-editor.php
5 months ago
pattern.php
5 months ago
radio-colors.php
5 months ago
radio.php
5 months ago
textarea.php
5 months ago
textbox.php
5 months ago
url.php
5 months ago
wp-editor.php
5 months ago
hidden.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Hidden Input Control |
| 5 | * |
| 6 | * Main options: |
| 7 | * name => a name of the control |
| 8 | * value => a value to show in the control |
| 9 | * default => a default value of the control if the "value" option is not specified |
| 10 | * |
| 11 | * @package factory-forms |
| 12 | * @since 1.0.0 |
| 13 | */ |
| 14 | |
| 15 | // Exit if accessed directly |
| 16 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | exit; |
| 18 | } |
| 19 | |
| 20 | if ( ! class_exists( 'Wbcr_FactoryForms600_HiddenControl' ) ) { |
| 21 | |
| 22 | class Wbcr_FactoryForms600_HiddenControl extends Wbcr_FactoryForms600_Control { |
| 23 | |
| 24 | public $type = 'hidden'; |
| 25 | |
| 26 | /** |
| 27 | * Shows the html markup of the control. |
| 28 | * |
| 29 | * @since 1.0.0 |
| 30 | * @return void |
| 31 | */ |
| 32 | public function html() { |
| 33 | $value = esc_attr( $this->getValue() ); |
| 34 | $name_on_form = $this->getNameOnForm(); |
| 35 | |
| 36 | $this->addHtmlAttr( 'id', $name_on_form ); |
| 37 | $this->addHtmlAttr( 'name', $name_on_form ); |
| 38 | $this->addHtmlAttr( 'value', $value ); |
| 39 | $this->addHtmlAttr( 'type', 'hidden' ); |
| 40 | |
| 41 | ?> |
| 42 | <input <?php $this->attrs(); ?>/> |
| 43 | <?php |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 |