__construct()
__construct(mixed $field, mixed $value, mixed $parent)
Field Constructor.
Example Declaration:
$fields = array(
'id'=>'7',
'type' => 'textarea',
'title' => __('Textarea Option - HTML Validated Custom', 'redux-framework-demo'),
'subtitle' => __('Custom HTML Allowed (wp_kses)', 'redux-framework-demo'),
'desc' => __('This is the description field, again good for additional info.', 'redux-framework-demo'),
'validate' => 'html_custom',
'default' => 'Some HTML is allowed in here.
',
'allowed_html' => array(
'a' => array(
'href' => array(),
'title' => array()
),
'br' => array(),
'em' => array(),
'strong' => array()
)
);
Required - must call the parent constructor, then assign field and value to vars, and obviously call the render field function
Example Documentation: $fields = array( 'id' => 'css_editor', 'type' => 'ace_editor', 'title' => ('CSS Code', 'redux-framework-demo'), 'subtitle' => ('Paste your CSS code here.', 'redux-framework-demo'), 'mode' => 'css', 'theme' => 'monokai', 'desc' => 'Possible modes can be found at http://ace.c9.io/</a>.', 'default' => "#header{\nmargin: 0 auto;\n}" );
Parameters
| mixed | $field | | Name | Type | Default | Description. | |-------------|--------|----------|---------------------------------------------| | type | string | 'text' | Controls the field type. | | id | string | | Must be unique to all other options. | | title | string | | Title of item to be displayed. | | subtitle | string | | Subtitle of item to be displayed. | | desc | string | | Description of item to be displayed. | | compiler | boolean | false | Flag to run the compiler hook. | | class | string | | Append any number of classes to the field. | | required | string/array | | Provide the parent and value which affects this field's visibility. | | default | string | | Default text. | | validate | string | | Controls the entered validation. | | placeholder | string | | Message to display when no text is present. | | rows | int | 6 | Numbers of text rows to display. | | allowed_html| array | | array of allowed HTML tags. See http://codex.wordpress.org/Function_Reference/wp_kses for more information. | |
| mixed | $value | Constructed by Redux class. Based on the passing in $field['defaults'] value and what is stored in the database. |
| mixed | $parent | ReduxFramework object is passed for easier pointing. |
