Class AdminPageFramework_FieldType_size
A combination field of a number and a select inputs that let the user set sizes.
This class defines the size
field type. By setting the
unit
argument, a custom unit can be set.
Field Definition Arguments
Field Type Specific Arguments
- units - (optional, array) defines the units to show. e.g.
array( 'px' => 'px', '%' => '%', 'em' => 'em' )
Default:array( 'px' => 'px', '%' => '%', 'em' => 'em', 'ex' => 'ex', 'in' => 'in', 'cm' => 'cm', 'mm' => 'mm', 'pt' => 'pt', 'pc' => 'pc' )
- is_multiple - (optional, boolean) if this is set to true,
the
multiple
attribute will be inserted into the field input tag, which enables the multiple selections for the user. - attributes - [3.0.0+] (optional, array) There are
additional nested arguments.
size
- (array) applies to the number input element that represents its size.unit
- (array) applies to the select input element that represents its unit.optgroup
- (array)applies to theoptgroup
tag element which gets created when grouping select items.option
- (array) applies to theoption
tag element.
Common Field Definition Arguments
For common field definition arguments, seeAdminPageFramework_Factory_Controller::addSettingField()
.
Example
array( 'field_id' => 'size_custom_unit_field', 'title' => __( 'Size with Custom Units', 'admin-page-framework-loader' ), 'type' => 'size', 'units' => array( 'grain' => __( 'grains', 'admin-page-framework-loader' ), 'dram' => __( 'drams', 'admin-page-framework-loader' ), 'ounce' => __( 'ounces', 'admin-page-framework-loader' ), 'pounds' => __( 'pounds', 'admin-page-framework-loader' ), ), 'default' => array( 'size' => 200, 'unit' => 'ounce' ), )
Package: AdminPageFramework\Common\Form\FieldType
Since: 2.1.5
Since: 3.3.1 Changed to extend
Extends: AdminPageFramework_FieldType_select
Image: http://admin-page-framework.michaeluno.jp/image/common/form/field_type/size.png
Located at factory/_common/form/field_type/size/AdminPageFramework_FieldType_size.php
Since: 2.1.5
Since: 3.3.1 Changed to extend
AdminPageFramework_FieldType
from
AdminPageFramework_FieldType_Base
.Extends: AdminPageFramework_FieldType_select
Image: http://admin-page-framework.michaeluno.jp/image/common/form/field_type/size.png
Located at factory/_common/form/field_type/size/AdminPageFramework_FieldType_size.php
Methods summary
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. Remark
$_aDefaultKeys holds shared default key-values defined in the base class.
|
protected
array
|
$aDefaultUnits |
#
Defines the default units. This goes to the 'units' element of the field definition array. Since
3.0.0
|