Admin Page Framework - Field Type Pack Documentation
  • Package
  • Class

Packages

  • AdminPageFrameworkFieldTypePack
    • CustomFieldType

Classes

  • AutoCompleteCustomFieldType
  • DateCustomFieldType
  • DateRangeCustomFieldType
  • DateTimeCustomFieldType
  • DateTimeRangeCustomFieldType
  • DialCustomFieldType
  • EDDSoftwareLicensingCustomFieldType
  • FontCustomFieldType
  • GeometryCustomFieldType
  • GridCustomFieldType
  • ImageCheckboxCustomFieldType
  • ImageRadioCustomFieldType
  • LinkCustomFieldType
  • RevealerCustomFieldType
  • TimeCustomFieldType
  • TimeRangeCustomFieldType

Class ImageCheckboxCustomFieldType

Defines the image_checkbox field type.

Field Type Specific Arguments

  • width - (integer) The image width.
  • height - (integer) The image height.

Example

array(
    'field_id'      => 'image_checkbox',
    'type'          => 'image_checkbox',
    'title'         => __( 'Image Checkbox', 'admin-page-framework-field-type-pack' ),
    'width'         => 96,
    'height'        => 64,
    'label_min_width'   => 200,
    'label'         => array(
        'a' => AdminPageFrameworkFieldTypePack_Registry::$sDirPath . '/asset/image/a.jpg',
        'b' => AdminPageFrameworkFieldTypePack_Registry::$sDirPath . '/asset/image/b.jpg',
        'c' => AdminPageFrameworkFieldTypePack_Registry::$sDirPath . '/asset/image/c.jpg',
    ),
    'after_input'   => array(
        'a' => "<br /><span>" . __( 'First Image' ) . "</span>",
        'b' => "<br /><span>" . __( 'Second Image' ) . "</span>",
        'c' => "<br /><span>" . __( 'Third Image' ) . "</span>",
    ),
),
Package: AdminPageFrameworkFieldTypePack\CustomFieldType
Since: 1.0.0
Located at custom-field-types/image_checkbox-custom-field-type/ImageCheckboxCustomFieldType.php

Methods summary

protected
# construct( )

The user constructor.

Loaded at the end of the constructor.

protected
# setUp( )

Loads the field type necessary components.

This method is triggered when a field definition array that calls this field type is parsed.

protected
# getEnqueuingScripts( )

Returns an array holding the urls of enqueuing scripts.

The returning array should be composed with all numeric keys. Each element can be either a string( the url or the path of the source file) or an array of custom argument.

Custom Argument Array

  • src - ( required, string ) The url or path of the target source file
  • handle_id - ( optional, string ) The handle ID of the script.
  • dependencies - ( optional, array ) The dependency array. For more information, see codex.
  • version - ( optional, string ) The stylesheet version number.
  • translation - ( optional, array ) The translation array. The handle ID will be used for the object name.
  • in_footer - ( optional, boolean ) Whether to enqueue the script before < / head > or before < / body > Default: <span class="php-keyword1">false</span>.
protected
# getEnqueuingStyles( )

Returns an array holding the urls of enqueuing styles.

Custom Argument Array

  • src - ( required, string ) The url or path of the target source file
  • handle_id - ( optional, string ) The handle ID of the stylesheet.
  • dependencies - ( optional, array ) The dependency array. For more information, see codex.
  • version - ( optional, string ) The stylesheet version number.
  • media - ( optional, string ) the description of the field which is inserted into the after the input field tag.
protected
# getScripts( )

Returns the field type specific JavaScript script.

protected
# getIEStyles( )

Returns IE specific CSS rules.

protected
# getStyles( )

Returns the field type specific CSS rules.

protected
# getField( mixed $aField )

Returns the output of the field type.

Magic methods summary

Properties summary

public array $aFieldTypeSlugs
#

Defines the field type slugs used for this field type.

The slug is used for the type key in a field definition array.

$this->addSettingFields(
     array(
         'section_id'    => ...,
         'type'          => 'image_checkbox',        // <--- THIS PART
         'field_id'      => ...,
         'title'         => ...,
     )
 );
protected array $aDefaultKeys
#

Defines the default key-values of this field type.

The keys are used for the field definition array.

$this->addSettingFields(
     array(
         'section_id'    => ...,
         'type'          => ...,
         'field_id'      => ...,
         'my_custom_key' => ...,    // <-- THIS PART
     )
 );

Remark

$_aDefaultKeys holds shared default key-values defined in the base class.
protected string $_sCheckboxClassSelector
#

The class selector to indicate that the input tag is a admin page framework checkbox.

This selector is used for the repeatable and sortable field scripts.

Since

3.1.7
Admin Page Framework - Field Type Pack Documentation generated by ApiGen 2.8.0