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 RevealerCustomFieldType

Defines the revealer field type.

This field type allows the user to hide and reveal chosen HTML elements.

Field Type Specific Arguments

  • select_type - (string) The selector type such as drop-down list, check boxes, or radio buttons.. Accepted values are select, radio, or checkbox.
  • attributes - (array) The array that defines the HTML attributes of the field elements.
    • select - (array) The attributes applied the select tag.
    • optgroup - (array) The attributes applied the optgroup tag.
    • option - (array) The attributes applied the option tag.
  • label - (array) Specifies the element to toggle the visibility. Set the jQuery selector of the element to the array key and it will be toggled when the user selects it.

Example

array(
    'field_id'      => 'revealer_field_by_id',
    'type'          => 'revealer',
    'title'         => __( 'Reveal Hidden Fields', 'admin-page-framework-field-type-pack' ),
    'default'       => 'undefined',
    'label'         => array( // the keys represent the selector to reveal, in this case, their tag id : #fieldrow-{section id}_{field id}
        'undefined' => __( '-- Select a Field --', 'admin-page-framework-field-type-pack' ),
        '#fieldrow-revealer_revealer_field_option_a' => __( 'Option A', 'admin-page-framework-field-type-pack' ),
        '#fieldrow-revealer_revealer_field_option_b, #fieldrow-revealer_revealer_field_option_c' => __( 'Option B and C', 'admin-page-framework-field-type-pack' ),
        '#fieldrow-revealer_another_revealer_field' => __( 'Another Revealer', 'admin-page-framework-field-type-pack' ),
    ),
    'description'   => __( 'Specify the selectors to reveal in the #code#label#/code# argument keys in the field definition array.', 'admin-page-framework-field-type-pack' ), ), array( 'field_id'      => 'revealer_field_option_a', 'type'          => 'textarea', 'default'       => __( 'Hi there!', 'admin-page-framework-field-type-pack' ), 'hidden'        => true, ), array( 'field_id'      => 'revealer_field_option_b', 'type'          => 'password', 'description'   => __( 'Type a password.', 'admin-page-framework-field-type-pack' ), 'hidden'        => true, ), array( 'field_id'      => 'revealer_field_option_c', 'type'          => 'text', 'description'   => __( 'Type text.', 'admin-page-framework-field-type-pack' ), 'hidden'        => true, ), array( 'field_id'      => 'another_revealer_field', 'type'          => 'revealer', 'select_type'   => 'radio', 'title'         => __( 'Another Hidden Field', 'admin-page-framework-field-type-pack' ), 'label'         => array( // the keys represent the selector to reveal, in this case, their tag id : #fieldrow-{field id} '.revealer_field_option_d' => __( 'Option D', 'admin-page-framework-field-type-pack' ), '.revealer_field_option_e' => __( 'Option E', 'admin-page-framework-field-type-pack' ), '.revealer_field_option_f' => __( 'Option F', 'admin-page-framework-field-type-pack' ), ), 'hidden'        => true, 'default'       => '.revealer_field_option_e', 'delimiter'     => '<br /><br />', // Sub-fields array( 'type'          => 'textarea', 'class'         => array( 'field' => 'revealer_field_option_d', ), 'label'         => '', 'default'       => '', 'delimiter'     => '', ), array( 'type'          => 'radio', 'label'         => array( 'a' => __( 'A', 'admin-page-framework-field-type-pack' ), 'b' => __( 'B', 'admin-page-framework-field-type-pack' ), 'c' => __( 'C', 'admin-page-framework-field-type-pack' ), ), 'default'       => 'a', 'class'         => array( 'field' => 'revealer_field_option_e', ), 'delimiter'     => '', ), array( 'type'          => 'select', 'label'         => array( 'i'     => __( 'i', 'admin-page-framework-field-type-pack' ), 'ii'    => __( 'ii', 'admin-page-framework-field-type-pack' ), 'iii'   => __( 'iii', 'admin-page-framework-field-type-pack' ), ), 'default'       => 'ii', 'class'         => array( 'field' => 'revealer_field_option_f', ), 'delimiter'     => '', ),
),
Package: AdminPageFrameworkFieldTypePack\CustomFieldType
Since: 1.0.0
Located at custom-field-types/revealer-custom-field-type/RevealerCustomFieldType.php

Methods summary

protected
# setUp( )

Loads the field type necessary components.

protected
# getEnqueuingScripts( )

Returns an array holding the urls of enqueuing scripts.

protected
# getEnqueuingStyles( )

Returns an array holding the urls of enqueuing styles.

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.

public
# _replyToAddRevealerjQueryPlugin( )

Adds the revealer jQuery plugin.

Since

3.0.0

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.
Admin Page Framework - Field Type Pack Documentation generated by ApiGen 2.8.0