addSettingFields(
'text_fields',
array( // Single text field
'field_id' => 'text',
// 'section_id' => 'text_fields', // can be omitted as it is set previously
'title' => __( 'Text', 'admin-page-framework-demo' ),
'description' => array(
__( 'Type something here. This text is inserted with the description argument in the field definition array.', 'admin-page-framework-demo' ),
__( 'The argument accepts as an array and each element will be treated as one paragraph.', 'admin-page-framework-demo' ),
),
'help' => __( 'This is a text field and typed text will be saved.', 'admin-page-framework-demo' )
. ' ' . __( 'This text is inserted with the help argument in the field definition array.', 'admin-page-framework-demo' ),
'type' => 'text',
'order' => 1, // ( optional )
'default' => 123456,
'attributes' => array(
'size' => 40,
),
),
array( // Password Field
'field_id' => 'password',
'title' => __( 'Password', 'admin-page-framework-demo' ),
'tip' => __( 'This input will be masked.', 'admin-page-framework-demo' ),
'type' => 'password',
'help' => __( 'This is a password type field; the user\'s entered input will be masked.', 'admin-page-framework-demo' ), //'
'attributes' => array(
'size' => 20,
),
'description' => __( 'The entered characters will be masked.', 'admin-page-framework-demo' ),
),
array( // Read-only
'field_id' => 'read_only_text',
'title' => __( 'Read Only', 'admin-page-framework-demo' ),
'type' => 'text',
'attributes' => array(
'size' => 20,
'readonly' => 'readonly',
// 'disabled' => 'disabled', // disabled can be specified like so
),
'value' => __( 'This is a read-only value.', 'admin-page-framework-demo' ),
'description' => __( 'The attribute can be set with the attributes argument.', 'admin-page-framework-demo' ),
),
array( // Number Field
'field_id' => 'number',
'title' => __( 'Number', 'admin-page-framework-demo' ),
'type' => 'number',
),
array( // Multiple text fields
'field_id' => 'text_multiple',
'title' => __( 'Multiple', 'admin-page-framework-demo' ),
'help' => __( 'Multiple text fields can be set by passing an array to the label argument.', 'admin-page-framework-demo' ),
'type' => 'text',
'default' => __( 'Hello world!', 'admin-page-framework-demo' ),
'label' => __( 'First', 'admin-page-framework-demo' ) . ': ',
'attributes' => array(
'size' => 20,
),
'capability' => 'manage_options',
'delimiter' => '
',
array(
'default' => 'Foo bar',
'label' => __( 'Second', 'admin-page-framework-demo' ) . ': ',
'attributes' => array(
'size' => 40,
)
),
array(
'default' => __( 'Yes, we can', 'admin-page-framework-demo' ),
'label' => __( 'Third', 'admin-page-framework-demo' ) . ': ',
'attributes' => array(
'size' => 60,
)
),
'description' => __( 'These are multiple text fields. To include multiple input fields associated with one field ID, use the numeric keys in the field definition array.', 'admin-page-framework-demo' ),
),
array( // Repeatable text fields
'field_id' => 'text_repeatable',
'title' => __( 'Repeatable', 'admin-page-framework-demo' ),
'type' => 'text',
'default' => 'a',
'capability' => 'manage_options',
'repeatable' => array(
'max' => 10,
'min' => 3,
),
'description' => array(
__( 'Press + / - to add / remove the fields. To enable the repeatable fields functionality, set the repeatable argument to true.', 'admin-page-framework-demo' ),
__( 'To set maximum and minimum numbers of fields, set the max and min arguments in the repeatable argument array in the field definition array.' ),
),
),
array( // Sortable text fields
'field_id' => 'text_sortable',
'title' => __( 'Sortable', 'admin-page-framework-demo' ),
'type' => 'text',
'default' => 'a',
'label' => __( 'Sortable Item', 'admin-page-framework-demo' ),
'sortable' => true,
'description' => __( 'Drag and drop the fields to change the order.', 'admin-page-framework-demo' ),
array(
'default' => 'b',
),
array(
'default' => 'c',
),
array(
'label' => __( 'Disabled Item', 'admin-page-framework-demo' ),
'default' => 'd',
'attributes' => array(
'disabled' => 'disabled',
),
),
'delimiter' => '
',
),
array( // Sortable + Repeatable text fields
'field_id' => 'text_repeatable_and_sortable',
'title' => __( 'Repeatable & Sortable', 'admin-page-framework-demo' ),
'type' => 'text',
'repeatable' => true,
'sortable' => true,
),
array( // Text Area
'field_id' => 'textarea',
'title' => __( 'Text Area', 'admin-page-framework-demo' ),
'description' => __( 'Type a text string here.', 'admin-page-framework-demo' ),
'type' => 'textarea',
'default' => __( 'Hello world!', 'admin-page-framework-demo' )
. ' ' . __( 'This is set as the default string.', 'admin-page-framework-demo' ),
'attributes' => array(
'rows' => 6,
'cols' => 60,
),
),
array( // Repeatable Text Areas
'field_id' => 'textarea_repeatable',
'title' => __( 'Repeatable', 'admin-page-framework-demo' ),
'type' => 'textarea',
'repeatable' => array(
'max' => 20,
'min' => 2,
),
'attributes' => array(
'rows' => 3,
'cols' => 60,
),
),
array( // Sortable Text Areas
'field_id' => 'textarea_sortable',
'title' => __( 'Sortable', 'admin-page-framework-demo' ),
'type' => 'textarea',
'sortable' => true,
'label' => __( 'Sortable Item', 'admin-page-framework-demo' ),
array(), // the second item
array(), // the third item
),
array( // Rich Text Editors
'field_id' => 'rich_textarea',
'title' => __( 'Rich Text Area', 'admin-page-framework-demo' ),
'type' => 'textarea',
'rich' => true, // just pass non empty value to enable the rich editor.
'attributes' => array(
'field' => array(
'style' => 'width: 100%;' // since the rich editor does not accept the cols attribute, set the width by inline-style.
),
),
'description' => __( 'The arguments can be passed to the rich argument.', 'admin-page-framework-demo' )
. sprintf( __( 'For more information see the Codex page.', 'admin-page-framework-demo' ), 'http://codex.wordpress.org/Function_Reference/wp_editor#Parameters' ),
array(
// pass the setting array to customize the editor. For the setting argument, see http://codex.wordpress.org/Function_Reference/wp_editor.
'rich' => array(
'media_buttons' => false,
'tinymce' => false
),
),
),
array( // Multiple text areas
'field_id' => 'textarea_multiple',
'title' => __( 'Multiple', 'admin-page-framework-demo' ),
'description' => __( 'These are multiple text areas.', 'admin-page-framework-demo' ),
'type' => 'textarea',
'label' => __( 'First', 'admin-page-framework-demo' ),
'default' => __( 'The first default text.', 'admin-page-framework-demo' ),
'delimiter' => '
',
'attributes' => array(
'rows' => 5,
'cols' => 60,
),
array(
'label' => __( 'Second', 'admin-page-framework-demo' ),
'default' => __( 'The second default text. See the background color is different from the others. This is done with the attributes argument.', 'admin-page-framework-demo' ),
'attributes' => array(
'rows' => 3,
'cols' => 40,
'style' => 'background-color: #F0F8FA;' // this changes the style of the textarea tag.
),
),
array(
'label' => __( 'Third', 'admin-page-framework-demo' ),
'default' => __( 'The third default text.', 'admin-page-framework-demo' ),
'attributes' => array(
'rows' => 2,
'cols' => 20,
),
),
),
array( // Repeatable TinyMCE Text Editor [3.1.6+]
'field_id' => 'repeatable_rich_textarea',
'title' => __( 'Repeatable', 'admin-page-framework-demo' ),
'type' => 'textarea',
'rich' => true,
'repeatable' => true,
'description' => __( 'As of v3.1.6, repeatable TinyMCE editor fields are supported.', 'admin-page-framework-demo' ),
),
array()
);
/*
* Selectors - dropdown (pulldown) list, checkbox, radio buttons, size selector
*/
$this->addSettingFields(
'selectors', // the target section ID
array( // Single Drop-down List
'field_id' => 'select',
'title' => __( 'Dropdown List', 'admin-page-framework-demo' ),
'type' => 'select',
'help' => __( 'This is the select field type.', 'admin-page-framework-demo' ),
'default' => 2, // the index key of the label array below which yields 'Yellow'.
'label' => array(
0 => __( 'Red', 'admin-page-framework-demo' ),
1 => __( 'Blue', 'admin-page-framework-demo' ),
2 => __( 'Yellow', 'admin-page-framework-demo' ),
3 => __( 'Orange', 'admin-page-framework-demo' ),
),
'description' => __( 'The key of the array of the label argument serves as the value of the option tag which will be sent to the form and saved in the database.', 'admin-page-framework-demo' )
. ' ' . __( 'So when you specify the default value with the default or value argument, specify the KEY.', 'admin-page-framework-demo' ),
),
array( // Single Drop-down List with Multiple Options
'field_id' => 'select_multiple_options',
// 'section_id' => 'selectors', // <-- this can be omitted since it is set in the previous field array
'title' => __( 'Multiple', 'admin-page-framework-demo' ),
'help' => __( 'This is the select field type with multiple elements.', 'admin-page-framework' ),
'type' => 'select',
'is_multiple' => true,
'default' => 3, // note that PHP array indices are zero-base, meaning the index count starts from 0 (not 1). 3 here means the fourth item of the array.
'label' => array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'November', 'October', 'December' ),
'description' => __( 'Use is_multiple argument to enable multiple selections.' ),
'attributes' => array(
'select' => array(
'size' => 10,
),
),
),
array( // Single Drop-down List with Multiple Options
'field_id' => 'select_multiple_groups',
'title' => __( 'Grouping', 'admin-page-framework-demo' ),
'type' => 'select',
'default' => 'b',
'label' => array(
'alphabets' => array( // each key must be unique throughout this 'label' element array.
'a' => 'a',
'b' => 'b',
'c' => 'c',
),
'numbers' => array(
0 => '0',
1 => '1',
2 => '2',
),
),
'attributes' => array( // the 'attributes' element of the select field type has three keys: select, 'option', and 'optgroup'.
'select' => array(
'style' => "width: 200px;",
),
'option' => array(
1 => array(
'disabled' => 'disabled',
'style' => 'background-color: #ECECEC; color: #888;',
),
),
'optgroup' => array(
'style' => 'background-color: #DDD',
)
),
'description' => __( 'To create grouped options, pass arrays with the key of the group label and pass the options as an array inside them.', 'admin-page-framework-demo' )
. ' ' . __( 'To style the pulldown (dropdown) list, use the attributes argument. For the select field type, it has three major keys, select, option, and optgroup, representing the tag names.', 'admin-page-framework-demo' ),
),
array( // Drop-down Lists with Mixed Types
'field_id' => 'select_multiple_fields',
'title' => __( 'Multiple', 'admin-page-framework-demo' ),
'description' => __( 'These are multiple sets of drop down list.', 'admin-page-framework-demo' ),
'type' => 'select',
'label' => array( 'dark', 'light' ),
'default' => 1,
'attributes' => array(
'select' => array(
'size' => 1,
),
'field' => array(
'style' => 'display: inline; clear: none', // this makes the field element inline, which means next fields continues from the right end of the field, not from the new line.
),
),
array(
'label' => array( 'river', 'mountain', 'sky', ),
'default' => 2,
),
array(
'label' => array( 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ),
'default' => array( 3, 4 ), // 'default' => '', will select none
'attributes' => array(
'select' => array(
'size' => 5,
'multiple' => 'multiple', // instead of 'is_multiple' => true, it is possible by setting it by the attribute key.
),
)
),
),
array( // Repeatable Drop-down List
'field_id' => 'select_repeatable',
'title' => __( 'Repeatable', 'admin-page-framework-demo' ),
'type' => 'select',
'repeatable' => true,
'description' => __( 'To enable repeatable fields, pass true to the repeatable argument.', 'admin-page-framework-demo' ),
'default' => 'y',
'label' => array(
'x' => 'X',
'y' => 'Y',
'z' => 'Z',
),
),
array( // Sortable Drop-down List
'field_id' => 'select_sortable',
'title' => __( 'Sortable', 'admin-page-framework-demo' ),
'type' => 'select',
'sortable' => true,
'default' => 'iii',
'before_label' =>
""
. __( 'Sortable Item', 'admin-page-framework-demo' )
. "",
'label' => array(
'i' => 'I',
'ii' => 'II',
'iii' => 'III',
'iiv' => 'IIV',
),
array(), // the second item - will inherit the main field's arguments
array(), // the third item
array(), // the forth item
),
array( // Single set of radio buttons
'field_id' => 'radio',
'title' => __( 'Radio Button', 'admin-page-framework-demo' ),
'type' => 'radio',
'label' => array(
'a' => 'Apple',
'b' => 'Banana ( this option is disabled. )',
'c' => 'Cherry'
),
'default' => 'c', // yields Cherry; its key is specified.
'after_label' => '
',
'attributes' => array(
'b' => array(
'disabled' => 'disabled',
),
),
'description' => __( 'Use the after_input argument to insert <br /> after each sub-field.', 'admin-page-framework-demo' )
. ' ' . __( 'To disable elements (or apply different attributes) on an individual element basis, use the attributes argument and create the element whose key name is the radio input element value.', 'admin-page-framework-demo' ),
),
array( // Multiple sets of radio buttons
'field_id' => 'radio_multiple',
'title' => __( 'Multiple Sets', 'admin-page-framework-demo' ),
'description' => __( 'Multiple sets of radio buttons. The horizontal line is set with the delimiter argument.', 'admin-page-framework-demo' ),
'type' => 'radio',
'delimiter' => '
description argument can be omitted though.', 'admin-page-framework-demo' ),
'type' => 'checkbox',
'label' => __( 'This is a check box.', 'admin-page-framework-demo' )
. ' ' . __( 'A string can be passed to the label argument for a single item.', 'admin-page-framework-demo' ),
'default' => false,
),
array( // Multiple checkbox items - for multiple checkbox items, set an array to the 'label' element.
'field_id' => 'checkbox_multiple_items',
'title' => __( 'Multiple', 'admin-page-framework-demo' ),
'type' => 'checkbox',
'label' => array(
'moon' => __( 'Moon', 'admin-page-framework-demo' ),
'earth' => __( 'Earth', 'admin-page-framework-demo' ) . ' (' . __( 'this option is disabled.', 'admin-page-framework-demo' ) . ')',
'sun' => __( 'Sun', 'admin-page-framework-demo' ),
'mars' => __( 'Mars', 'admin-page-framework-demo' ),
),
'default' => array(
'moon' => true,
'earth' => false,
'sun' => true,
'mars' => false,
),
'attributes' => array(
'earth' => array(
'disabled' => 'disabled',
),
),
'description' => __( 'It is possible to disable checkbox items on an individual basis.', 'admin-page-framework-demo' ),
'after_label' => 'size and the unit arguments needs to be set.', 'admin-page-framework-demo' ),
'description' => __( 'The default units and the lengths for CSS.', 'admin-page-framework-demo' )
. ' ' . $sDescription,
'type' => 'size',
'default' => array(
'size' => 5,
'unit' => '%',
),
),
array( // Size with custom units
'field_id' => 'size_custom_unit_field',
'title' => __( 'Size with Custom Units', 'admin-page-framework-demo' ),
'help' => $sDescription = __( 'The units can be specified so it can be quantity, length, or capacity etc.', 'admin-page-framework-demo' ),
'description' => $sDescription,
'type' => 'size',
'units' => array(
'grain' => __( 'grains', 'admin-page-framework-demo' ),
'dram' => __( 'drams', 'admin-page-framework-demo' ),
'ounce' => __( 'ounces', 'admin-page-framework-demo' ),
'pounds' => __( 'pounds', 'admin-page-framework-demo' ),
),
'default' => array(
'size' => 200,
'unit' => 'ounce'
),
),
array( // Size with custom attributes
'field_id' => 'size_field_custom_attributes',
'title' => __( 'Size with Custom Attributes', 'admin-page-framework-demo' ),
'type' => 'size',
'units' => array( // Pass the group label as the key of an option array.
__( 'Metric Unit System', 'admin-page-framework' ) => array( // each key must be unique throughout this 'label' element array.
'mm' => 'mm (' . __( 'millimetre', 'admin-page-framework' ) . ')',
'cm' => 'cm (' . __( 'centmeter', 'admin-page-framework' ) . ')',
'm' => 'm (' . __( 'meter', 'admin-page-framework' ) . ')',
'km' => 'km (' . __( 'kilometer', 'admin-page-framework' ) . ')',
),
__( 'Imperial and US Unit System', 'admin-page-framework' ) => array(
'in' => 'in (' . __( 'inch', 'admin-page-framework' ) . ')',
'ft' => 'ft (' . __( 'foot', 'admin-page-framework' ) . ')',
'yd' => 'yd (' . __( 'yard', 'admin-page-framework' ) . ')',
'ml' => 'ml (' . __( 'mile', 'admin-page-framework' ) . ')',
),
__( 'Astronomical Units', 'admin-page-framework' ) => array(
'au' => 'au (' . __( 'astronomical unit', 'admin-page-framework' ) . ')',
'ly' => 'ly (' . __( 'light year', 'admin-page-framework' ) . ')',
'pc' => 'pc (' . __( 'parsec', 'admin-page-framework' ) . ')',
),
),
'default' => array(
'size' => 15.2,
'unit' => 'ft'
),
'attributes' => array( // the size field type has four initial keys: size, option, optgroup.
'size' => array(
'style' => 'background-color: #FAF0F0;',
'step' => 0.1,
),
'unit' => array(
'style' => 'background-color: #F0FAF4',
),
'option' => array(
'cm' => array( // applies only to the 'cm' element of the option elements
'disabled' => 'disabled',
'class' => 'disabled',
),
'style' => 'background-color: #F7EFFF', // applies to all the option elements
),
'optgroup' => array(
'style' => 'background-color: #EFEFEF',
__( 'Astronomical Units', 'admin-page-framework' ) => array(
'disabled' => 'disabled',
),
),
),
'description' => __( 'The size field type has four initial keys in the attributes array element: size, unit, optgroup, and option.', 'admin-page-framework-demo' ),
),
array( // Multiple Size Fields
'field_id' => 'sizes_field',
'title' => __( 'Multiple', 'admin-page-framework-demo' ),
'type' => 'size',
'label' => __( 'Weight', 'admin-page-framework-demo' ),
'units' => array( 'mg'=>'mg', 'g'=>'g', 'kg'=>'kg' ),
'default' => array( 'size' => 15, 'unit' => 'g' ),
'delimiter' => 'query argument, you can query post types to retrieve.', 'admin-page-framework-demo' )
. ' ' . sprintf( __( 'For the specification, see the Parameter section of codex for the get_post_types() function.', 'admin-page-framework-demo' ), 'http://codex.wordpress.org/Function_Reference/get_post_types#Parameters' ) ,
),
array(
'field_id' => 'post_type_checklist_repeatable',
'title' => __( 'Repeatable', 'admin-page-framework-demo' ),
'type' => 'posttype',
'repeatable' => true,
'delimiter' => 'query argument array, you can customize how the terms should be retrieved.', 'admin-page-framework-demo' ),
sprintf( __( 'For the structure and the array key specifications, refer to the parameter section of the get_term() function.', 'admin-page-framework-demo' ), 'http://codex.wordpress.org/Function_Reference/get_terms#Parameters' ),
),
// (required) Determines which taxonomies should be listed
'taxonomy_slugs' => $aTaxnomies = get_taxonomies( '', 'names' ),
// (optional) This defines the default query argument. For the structure and supported arguments, see http://codex.wordpress.org/Function_Reference/get_terms#Parameters
'query' => array(
'depth' => 2,
'orderby' => 'term_id', // accepts 'ID', 'term_id', or 'name'
'order' => 'DESC',
// 'exclude' => '1', // removes the 'Uncategorized' category.
// 'search' => 'PHP', // the search keyward
// 'parent' => 9, // only show terms whose direct parent ID is 9.
// 'child_of' => 8, // only show child terms of the term ID of 8.
),
// (optional) This allows to set a query argument for each taxonomy.
// Note that each element will be merged with the above default 'query' argument array.
// So unset keys here will be overridden by the default argument array above.
'queries' => array(
// taxonomy slug => query argument array
'category' => array(
'depth' => 2,
'orderby' => 'term_id',
'order' => 'DESC',
'exclude' => array( 1 ),
),
'post_tag' => array(
'orderby' => 'name',
'order' => 'ASC',
// 'include' => array( 4, ), // term ids
),
),
),
array(
'field_id' => 'taxonomy_multiple_checklists',
'title' => __( 'Multiple', 'admin-page-framework-demo' ),
'type' => 'taxonomy',
'taxonomy_slugs' => $aTaxnomies,
'before_field' => '' . __( 'For I', 'admin-page-framework-demo' ) . '
', array( 'before_field' => '' . __( 'For II', 'admin-page-framework-demo' ) . '
', ), array( 'before_field' => '' . __( 'For III', 'admin-page-framework-demo' ) . '
', ), ), array( 'field_id' => 'taxonomy_checklist_repeatable', 'title' => __( 'Repeatable', 'admin-page-framework-demo' ), 'type' => 'taxonomy', 'repeatable' => true, 'taxonomy_slugs' => $aTaxnomies, ), array() ); /* * MISC fields */ $this->addSettingFields( 'color_picker', // the target section ID. array( // Color Picker 'field_id' => 'color_picker_field', 'title' => __( 'Color Picker', 'admin-page-framework-demo' ), 'type' => 'color', ), array( // Multiple Color Pickers 'field_id' => 'multiple_color_picker_field', 'title' => __( 'Multiple', 'admin-page-framework-demo' ), 'type' => 'color', 'label' => __( 'First', 'admin-page-framework-demo' ), 'delimiter' => 'href argument to enable this option.', 'admin-page-framework-demo' ),
'label' => __( 'Google', 'admin-page-framework-demo' ),
'href' => 'http://www.google.com',
'attributes' => array(
'class' => 'button button-secondary',
'title' => __( 'Go to Google!', 'admin-page-framework-demo' ),
'style' => 'background-color: #C1DCFA;',
'field' => array(
'style' => 'display: inline; clear: none;',
),
),
array(
'label' => __( 'Yahoo', 'admin-page-framework-demo' ),
'href' => 'http://www.yahoo.com',
'attributes' => array(
'class' => 'button button-secondary',
'title' => __( 'Go to Yahoo!', 'admin-page-framework-demo' ),
'style' => 'background-color: #C8AEFF;',
),
),
array(
'label' => __( 'Bing', 'admin-page-framework-demo' ),
'href' => 'http://www.bing.com',
'attributes' => array(
'class' => 'button button-secondary',
'title' => __( 'Go to Bing!', 'admin-page-framework-demo' ),
'style' => 'background-color: #FFE5AE;',
),
),
),
array(
'field_id' => 'submit_button_download',
'title' => __( 'Download Button', 'admin-page-framework-demo' ),
'type' => 'submit',
'label' => __( 'Admin Page Framework', 'admin-page-framework-demo' ),
'description' => __( 'Download the latest version of the Admin Page Framework Demo plugin.', 'admin-page-framework-demo' ),
'href' => 'http://downloads.wordpress.org/plugin/admin-page-framework.latest-stable.zip',
),
array( // Submit button as a redirect
'field_id' => 'submit_button_redirect',
'title' => __( 'Redirect Button', 'admin-page-framework-demo' ),
'type' => 'submit',
'description' => sprintf( __( 'Unlike the above link buttons, this button saves the options and then redirects to: %1$s', 'admin-page-framework-demo' ), admin_url() )
. ' ' . __( 'To enable this functionality, set the url to the redirect_url argument in the field definition array.', 'admin-page-framework-demo' ),
'label' => __( 'Dashboard', 'admin-page-framework-demo' ),
'redirect_url' => admin_url(),
'attributes' => array(
'class' => 'button button-secondary',
),
),
array( // Reset Submit button
'field_id' => 'submit_button_reset',
'title' => __( 'Reset Button', 'admin-page-framework-demo' ),
'type' => 'submit',
'label' => __( 'Reset', 'admin-page-framework-demo' ),
'reset' => true,
'attributes' => array(
'class' => 'button button-secondary',
),
'description' => __( 'If you press this button, a confirmation message will appear and then if you press it again, it resets the option.', 'admin-page-framework-demo' ),
),
array( // with an image
'field_id' => 'image_submit_button',
'title' => __( 'Image Submit Button', 'admin-page-framework-demo' ),
'type' => 'submit',
'href' => 'http://en.michaeluno.jp/donate',
'attributes' => array(
'src' => APFDEMO_DIRNAME . '/asset/image/donation.gif',
'alt' => __( 'Submit', 'admin-page-framework-demo' ),
'class' => '',
),
'description' => __( 'For a custom image submit button, set the image url in the src attribute with the attributes argument.', 'admin-page-framework-demo' )
. ' ' . __( 'This button will take you to the donation page for the developer of this framework. If you like to donate, please do so to help the development!', 'admin-page-framework-demo' ),
),
array()
);
/*
* Verification Example
* */
$this->addSettingFields(
'verification', // the target section ID
array(
'field_id' => 'verify_text_field',
'title' => __( 'Verify Text Input', 'admin-page-framework-demo' ),
'type' => 'text',
'description' => __( 'Try setting a non numeric value here.', 'admin-page-framework-demo' ),
),
array(
'field_id' => 'other_text_field',
'title' => __( 'Other Field', 'admin-page-framework-demo' ),
'type' => 'text',
'description' => __( 'This field will not be validated.', 'admin-page-framework-demo' ),
),
array(
'field_id' => 'verify_text_field_submit', // this submit field ID can be used in a validation callback method
'type' => 'submit',
'label' => __( 'Verify', 'admin-page-framework-demo' ),
)
);
$this->addSettingFields(
'section_verification', // the target sectin ID
array(
'field_id' => 'item_a',
'title' => __( 'Choose Item', 'admin-page-framework-demo' ),
'type' => 'select',
'label' => array(
0 => '--- ' . __( 'Select Item', 'admin-page-framework-demo' ) . ' ---',
'one' => __( 'One', 'admin-page-framework-demo' ),
'two' => __( 'Two', 'admin-page-framework-demo' ),
'three' => __( 'Three', 'admin-page-framework-demo' ),
),
),
array(
'field_id' => 'item_b', // this submit field ID can be used in a validation callback method
'type' => 'text',
'description' => __( 'Select one above or enter text here.', 'admin-page-framework-demo' ),
)
);
$this->addSettingFields(
array(
'field_id' => 'mixed_fields',
'section_id' => 'mixed_types',
'title' => __( 'Text and Hidden', 'admin-page-framework-demo' ),
'type' => 'text',
'default' => 'abc',
array(
'type' => 'hidden',
'value' => 'xyz',
),
'attributes' => array(
'field' => array(
'style' => 'display: inline; clear:none;' // since the rich editor does not accept the cols attribute, set the width by inline-style.
),
),
'description' => __( 'A hidden field is embedded. This is useful when you need to embed extra information to be sent with the visible elements.', 'admin-page-framework-demo' ),
),
array()
);
$this->addSettingFields(
'section_title_field_type', // the target section ID
array(
'field_id' => 'section_title_field',
'type' => 'section_title',
'label' => '