Class AdminPageFramework_FieldType_checkbox
A check box that lets the user enable/disable an option item.
This class defines the checkbox field type.
Field Definition Arguments
Field Type Specific Arguments
- select_all_button - [3.3.0+] (optional, boolean|array) pass
true
to enable theSelect All
button. To set a custom label, set the text such as__( 'Check All', 'test-domain' )
. Default:true
. - select_none_button - [3.3.0+] (optional, boolean|array)
pass
true
to enable theSelect None
button. To set a custom label, set the text such as__( 'Check All', 'test-domain' )
. Default:true
. - save_unchecked - [3.8.8+] (optional, boolean) Whether to
store the values of unchecked items. Default:
true
.
Common Field Definition Arguments
For common field definition arguments, seeAdminPageFramework_Factory_Controller::addSettingField()
.
Example
array( 'field_id' => 'checkbox', 'title' => __( 'Checkbox', 'admin-page-framework-loader' ), 'type' => 'checkbox', 'label' => __( 'This is a check box.', 'admin-page-framework-loader' ) . ' ' . __( 'A string can be passed to the label argument for a single item.', 'admin-page-framework-loader' ), 'default' => false, )
array( 'field_id' => 'checkbox_multiple_items', 'title' => __( 'Multiple', 'admin-page-framework-loader' ), 'type' => 'checkbox', 'label' => array( 'moon' => __( 'Moon', 'admin-page-framework-loader' ), 'earth' => __( 'Earth', 'admin-page-framework-loader' ) . ' (' . __( 'this option is disabled.', 'admin-page-framework-loader' ) . ')', 'sun' => __( 'Sun', 'admin-page-framework-loader' ), 'mars' => __( 'Mars', 'admin-page-framework-loader' ), ), 'default' => array( 'moon' => true, 'earth' => false, 'sun' => true, 'mars' => false, ), 'attributes' => array( 'earth' => array( 'disabled' => 'disabled', ), ), 'after_label' => '<br />', )
Package: AdminPageFramework\Common\Form\FieldType
Since: 2.1.5
Since: 3.3.1 Changed to extend
Image: http://admin-page-framework.michaeluno.jp/image/common/form/field_type/checkbox.png
Located at factory/_common/form/field_type/checkbox/AdminPageFramework_FieldType_checkbox.php
Since: 2.1.5
Since: 3.3.1 Changed to extend
AdminPageFramework_FieldType
from
AdminPageFramework_FieldType_Base
.Image: http://admin-page-framework.michaeluno.jp/image/common/form/field_type/checkbox.png
Located at factory/_common/form/field_type/checkbox/AdminPageFramework_FieldType_checkbox.php
Methods summary
protected
array
|
#
getEnqueuingScripts( )
|
Magic methods summary
Properties summary
public
array
|
$aFieldTypeSlugs |
#
Defines the field type slugs used for this field type. |
protected
array
|
$aDefaultKeys |
#
Defines the default key-values of this field type. |
Related
Direct known subclasses
AdminPageFramework_FieldType_posttype
,
AdminPageFramework_FieldType_taxonomy