Class AdminPageFramework_FieldType
The base class for the users to create their custom field types.
When a framework user implements a custom field type into his/her work, this class may be extended to create a field definition class.
Steps to Include a Custom Field Type
- Define a custom field type with a class extending the
AdminPageFramework_FieldType class.
- Set the field type slug such as autocomplete with the $aFieldTypeSlugs property.
- Set the default field array definition keys with the $aDefaultKeys property.
- Write additional code in the setUp() method that will be performed when the field type definition is parsed.
- Add scripts and styles with getEnqueuingScripts(), getEnqueuingStyles(), getScripts(), getStyles() etc.
- Compose the output HTML structure with the passed $aField field definition array in the getField() method.
- Include the definition file and instantiate the class in the
script(plugin,theme etc.).
new MyCustomFieldTypeClass( 'MY_CLASS_NAME' ); // pass the PHP class name that extends the framework's class to the first parameter.
- Define fields with the custom field type with the
addSettingFields() method in the framework extending class.
$this->addSettingFields( array( 'field_id' => 'my_field_id', 'section_id' => 'my_section_id', 'type' => 'my_custom_field_type_slug', // <-- here put the field type slug '...' => '...' ) );
- AdminPageFramework_Utility_Array
-
AdminPageFramework_Utility_String
-
AdminPageFramework_Utility_Path
-
AdminPageFramework_Utility_URL
-
AdminPageFramework_Utility
-
AdminPageFramework_WPUtility_URL
-
AdminPageFramework_WPUtility_HTML
-
AdminPageFramework_WPUtility_Page
-
AdminPageFramework_WPUtility_Hook
-
AdminPageFramework_WPUtility_File
-
AdminPageFramework_WPUtility_Option
-
AdminPageFramework_WPUtility
-
AdminPageFramework_FieldType_Base
-
AdminPageFramework_FieldType
Package: AdminPageFramework\FieldType
Since: 2.1.5
Since: 3.0.0 Changed the name from AdminPageFramework_CustomFieldType to AdminPageFramework_FieldType.
Remark: The user will extend this class to define their custom field types.
Located at field_type/AdminPageFramework_FieldType.php
Methods summary
protected
|
|
protected
|
#
getScripts( )
|
protected
|
#
getIEStyles( )
|
protected
|
|
protected
|
|
protected
|
|
protected
|
Methods inherited from AdminPageFramework_FieldType_Base
__construct()
,
_getScript_CustomMediaUploaderObject()
,
_replyToEnqueueMedia()
,
_replyToFieldLoader()
,
_replyToFieldTypeSetter()
,
_replyToGetEnqueuingScripts()
,
_replyToGetEnqueuingStyles()
,
_replyToGetField()
,
_replyToGetInputIEStyles()
,
_replyToGetScripts()
,
_replyToGetStyles()
,
_replyToRemovingMediaLibraryTab()
,
_replyToReplaceThickBoxText()
,
enqueueMediaUploader()
,
getDefinitionArray()
,
getFieldElementByKey()
,
replyToRegisterInputFieldType()
Methods inherited from AdminPageFramework_WPUtility_Option
getOption()
Methods inherited from AdminPageFramework_WPUtility_File
getScriptData()
Methods inherited from AdminPageFramework_WPUtility_Hook
addAndApplyFilter()
,
addAndApplyFilters()
,
addAndDoAction()
,
addAndDoActions()
,
doActions()
,
getFilterArrayByPrefix()
Methods inherited from AdminPageFramework_WPUtility_Page
getCurrentPostType()
,
isPostDefinitionPage()
,
isPostListingPage()
Methods inherited from AdminPageFramework_WPUtility_HTML
generateAttributes()
,
generateDataAttributes()
Methods inherited from AdminPageFramework_WPUtility_URL
getCurrentAdminURL()
,
getQueryAdminURL()
,
getQueryURL()
,
getSRCFromPath()
,
resolveSRC()
Methods inherited from AdminPageFramework_Utility
getQueryValueInURLByKey()
Methods inherited from AdminPageFramework_Utility_URL
getCurrentURL()
Methods inherited from AdminPageFramework_Utility_Path
getCallerScriptPath()
,
getRelativePath()
Methods inherited from AdminPageFramework_Utility_String
fixNumber()
,
minifyCSS()
,
sanitizeSlug()
,
sanitizeString()
Methods inherited from AdminPageFramework_Utility_Array
castArrayContents()
,
getArrayDimension()
,
getArrayValueByArrayKeys()
,
getAsArray()
,
getCorrespondingArrayValue()
,
getIntegerElements()
,
getNonIntegerElements()
,
invertCastArrayContents()
,
isAssociativeArray()
,
isLastElement()
,
numerizeElements()
,
shiftTillTrue()
,
uniteArrays()
,
uniteArraysRecursive()
Magic methods summary
Properties summary
public
array
|
$aFieldTypeSlugs | |
protected
array
|
$aDefaultKeys |
Properties inherited from AdminPageFramework_FieldType_Base
$_aDefaultKeys
,
$_sFieldSetType
,
$oMsg