/** * Constructor * @since 1.0 * @param string $name Name of field. * @param array/string $args List of Arguments. */ function __construct($name, $label = FALSE, $args = array()) { $args = wp_parse_args($args); $args['label'] = $label; $args['echo_tag'] = FALSE; parent::__construct('textarea', $name, $args); }
/** * Constructor * @since 1.0 * @param string $name Name of field. * @param array/string $args List of Arguments. */ function __construct($name, $args = array()) { $args = wp_parse_args($args); $args['close_tag'] = FALSE; // No Close tag for Input type Text parent::__construct('input', $name, $args); $this->add_param('type', 'text'); // This is a text field! }
/** * Constructor * @since 1.0.0 * @param string $name Name of field. * @param string $label Label of field. * @param string $description Description of field which is shown under element * @param array/string $args List of Arguments. */ function __construct($name, $label = FALSE, $args = array()) { $defaults = array('description' => '', 'default' => '', 'disabled' => FALSE); $args = wp_parse_args($args, $defaults); $args['label'] = $label; parent::__construct('input', $name, $args); $this->add_param('type', 'text'); // This is a text field! }
/** * Constructor * @since 1.0 * @param string $name The name of field. * @param array/string $args List of Arguments. */ function __construct($name, $args = array()) { global $post, $skip_form_option_group; $args = wp_parse_args($args); extract($args, EXTR_SKIP); $args['close_tag'] = FALSE; // No Close tag for Input type Text parent::__construct('input', $name, $args); $this->add_param('type', 'hidden'); // This is a text field! }
class File extends Form_Element { var $delete; var $wp_browse; /** * Constructor * @since 1.0 * @param string $name Name of File Field. * @param array/string $args List of Arguments. */ function __construct($name, $label = FALSE, $args = array()) { $defaults = array('delete' => FALSE, 'save' => TRUE); $args = wp_parse_args($args, $defaults);
/** * Constructor * @since 1.0 * @param string $name Name of Color field. * @param array/string $args List of Arguments. */ function __construct($name, $label = FALSE, $args = array()) { $defaults = array('size' => '', 'multiselect' => FALSE); $args = wp_parse_args($args, $defaults); $args['label'] = $label; $args['close_tag'] = TRUE; parent::__construct('select', $name, $args); if ('' != $args['size']) { $this->add_param('size', $args['size']); } if ($args['multiselect']) { $this->add_param('multiple', 'multiple'); } }
*/ namespace skip\v1_0_0; class Button extends Form_Element { /** * Constructor * @since 1.0 * @param string $value The text which appears on the button. * @param array/string $args List of Arguments. */ function __construct($value, $args = array()) { $defaults = array('name' => '', 'submit' => TRUE); $args = wp_parse_args($args, $defaults); extract($args, EXTR_SKIP);
/** * Constructor * @since 1.0 * @param string $name The name of the checkbox field. * @param string $value The value of the checkbox element which will be saved if box is checked. * @param array/string $args List of Arguments. */ function __construct($name, $value, $label = FALSE, $args = array()) { global $skip_hidden_elements; $defaults = array('checked' => FALSE); $args = wp_parse_args($args, $defaults); $args['label'] = $label; $args['close_tag'] = FALSE; // No Close tag for Input type Button parent::__construct('input', $name, $args); $this->add_param('type', 'checkbox'); $this->add_param('value', $value); // Overwriting value from DB if ('' != $this->value || $this->value == 'checked' || $args['checked']) { $this->add_param('checked', 'checked'); } }
/** * Constructor * @since 1.0 * @param string $name Name of field. * @param array/string $args List of Arguments. */ function __construct($name, $label = FALSE, $args = array()) { $defaults = array('rows' => '', 'cols' => '', 'description' => '', 'default' => '', 'disabled' => FALSE); $args = wp_parse_args($args, $defaults); $args['label'] = $label; $args['close_tag'] = TRUE; // No Close tag for Input type Text parent::__construct('textarea', $name, $args); if ('' != $args['rows']) { $this->add_param('rows', $args['rows']); } if ('' != $args['cols']) { $this->add_param('cols', $args['cols']); } if ('' != $this->value) { $this->add_element($this->value); }
/** * Constructor * @since 1.0 * @param string $name Name of field. * @param string $value The value of the checkbox element which will be saved if Radiobutton is checked. * @param array/string $args List of Arguments. */ function __construct($name, $value, $label = FALSE, $args = array()) { /* * Additional parent args: * 'id' * 'classes' * 'before_element' * 'after_element' * 'params' */ $defaults = array('checked' => FALSE); $args = wp_parse_args($args, $defaults); $args['label'] = $label; $args['close_tag'] = FALSE; // No Close tag for Input type Button parent::__construct('input', $name, $args); $this->add_param('type', 'radio'); // This is a radio button $this->add_param('value', $value); // Overwriting value from DB if ($value == $this->value || $this->value == 'checked' || $args['checked']) {