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 DateRangeCustomFieldType

Defines the date range field type.

Field Type Specific Arguments

  • date_format - (string) date format default: yy/mm/dd.
  • options - (array) the option values passed to the datepicker() jQuery method.
  • options[from] - (array) the option values passed to the datepicker() jQuery method, which applies to the From input.
  • options[to] - (array) the option values passed to the datepicker() jQuery method, which applies to the To input.

Example

array( // Single date_range picker
    'field_id'      => 'date_range',
    'title'         => __( 'Date Range', 'admin-page-framework-field-type-pack' ),
    'type'          => 'date_range',
),
array( // Single date_range picker
    'field_id'      => 'date_range_repeatable',
    'title'         => __( 'Repeatable Date Range', 'admin-page-framework-field-type-pack' ),
    'type'          => 'date_range',
    'repeatable'    => true,
    'sortable'      => true,
    'options'       => array(
        'numberOfMonths' => 2,
    ),
),
Package: AdminPageFrameworkFieldTypePack\CustomFieldType
Since: 1.0.0
Located at custom-field-types/date-time-custom-field-types/DateRangeCustomFieldType.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 this field type.

protected
# _getDatePickerEnablerScript( mixed $sInputID, mixed $sDateFormat, mixed $asOptions_From, mixed $asOptions_To )

A helper function for the above _replyToGetField() method.

protected
# _getSubOptions( mixed $sKey, array $aOptions )

Returns the option array of the given sub-option key.

This is used for sub-option elements. In this field type, there are 'from' and 'to' sub-elements. The user can set the shared options in the first depth of the 'options' argument array. And in the first depth, the 'from' and 'to' argument arrays can be set and they take their precedence.

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