Class AdminPageFramework_PostType_Controller
Provides methods of views for the post type factory class.
Those methods are public and provides means for users to set property
values.
-
AdminPageFramework_Factory_Router
-
AdminPageFramework_Factory_Model
-
AdminPageFramework_Factory_View
-
AdminPageFramework_Factory_Controller
-
AdminPageFramework_Factory
-
AdminPageFramework_PostType_Router
-
AdminPageFramework_PostType_Model
-
AdminPageFramework_PostType_View
-
AdminPageFramework_PostType_Controller
Methods summary
public
|
#
__construct( mixed $oProp )
Sets up built-in objects.
Sets up built-in objects.
Overrides
|
public
|
#
setUp( )
The method for all necessary set-ups.
The method for all necessary set-ups.
Example
public function setUp() {
$this->setAutoSave( false );
$this->setAuthorTableFilter( true );
$this->addTaxonomy(
'sample_taxonomy',
array(
'labels' => array(
'name' => 'Genre',
'add_new_item' => 'Add New Genre',
'new_item_name' => "New Genre"
),
'show_ui' => true,
'show_tagcloud' => false,
'hierarchical' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_table_filter' => true,
'show_in_sidebar_menus' => false,
)
);
}
Since
2.0.0
Remark
The user should override this method in their class definition.
A callback for the wp_loaded hook.
Overrides
AdminPageFramework_Factory_Controller::setUp
|
public
array
|
#
enqueueStyles( mixed $aSRCs, mixed $aCustomArgs = array() )
Enqueues styles by page slug and tab slug.
Enqueues styles by page slug and tab slug.
Returns
array An array holding the handle IDs of queued items.
Since
3.0.0
Overrides
AdminPageFramework_Factory_Controller::enqueueStyles
|
public
string
|
#
enqueueStyle( string $sSRC, array $aCustomArgs = array() )
Enqueues a style by page slug and tab slug.
Enqueues a style by page slug and tab slug.
Parameters
- $sSRC
string The URL of the stylesheet to enqueue, the absolute file path, or the relative
path to the root directory of WordPress. Example: '/css/mystyle.css'.
- $aCustomArgs
array (optional) The argument array for more advanced parameters.
Custom Argument Array
- 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 after the input field tag.
Returns
string The script handle ID. If the passed url is not a valid url string, an empty
string will be returned.
Since
3.0.0
See
Overrides
AdminPageFramework_Factory_Controller::enqueueStyle
|
public
array
|
#
enqueueScripts( mixed $aSRCs, mixed $aCustomArgs = array() )
Enqueues scripts by page slug and tab slug.
Enqueues scripts by page slug and tab slug.
Returns
array An array holding the handle IDs of queued items.
Since
3.0.0
Overrides
AdminPageFramework_Factory_Controller::enqueueScripts
|
public
string
|
#
enqueueScript( string $sSRC, array $aCustomArgs = array() )
Enqueues a script by page slug and tab slug.
Enqueues a script by page slug and tab slug.
Example
$this->enqueueScript(
plugins_url( 'asset/js/test.js' , __FILE__ ),
array(
'handle_id' => 'my_script',
'translation' => array(
'a' => 'hello world!',
'style_handle_id' => $sStyleHandle,
),
)
);
Parameters
- $sSRC
string The URL of the stylesheet to enqueue, the absolute file path, or the relative
path to the root directory of WordPress. Example: '/js/myscript.js'.
- $aCustomArgs
array (optional) The argument array for more advanced parameters.
Custom Argument Array
- 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: false.
Returns
string The script handle ID. If the passed url is not a valid url string, an empty
string will be returned.
Since
3.0.0
See
Overrides
AdminPageFramework_Factory_Controller::enqueueScript
|
protected
|
#
setAutoSave( boolean $bEnableAutoSave = True )
Enables or disables the auto-save feature in the custom post type's post
submission page.
Enables or disables the auto-save feature in the custom post type's post
submission page.
Example
$this->setAutoSave( false );
Parameters
- $bEnableAutoSave
boolean If true, it enables the auto-save; otherwise, it disables it. return void
Since
2.0.0
|
protected
|
#
addTaxonomy( string $sTaxonomySlug, array $aArgs, array $aAdditionalObjectTypes = array() )
Adds a custom taxonomy to the class post type.
Example
$this->addTaxonomy(
'sample_taxonomy',
array(
'labels' => array(
'name' => 'Genre',
'add_new_item' => 'Add New Genre',
'new_item_name' => "New Genre"
),
'show_ui' => true,
'show_tagcloud' => false,
'hierarchical' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_table_filter' => true,
'show_in_sidebar_menus' => false,
)
);
Adds a custom taxonomy to the class post type.
Example
$this->addTaxonomy(
'sample_taxonomy',
array(
'labels' => array(
'name' => 'Genre',
'add_new_item' => 'Add New Genre',
'new_item_name' => "New Genre"
),
'show_ui' => true,
'show_tagcloud' => false,
'hierarchical' => true,
'show_admin_column' => true,
'show_in_nav_menus' => true,
'show_table_filter' => true,
'show_in_sidebar_menus' => false,
)
);
Parameters
- $sTaxonomySlug
string $sTaxonomySlug The taxonomy slug.
- $aArgs
array $aArgs The taxonomy argument array passed to the second parameter of the register_taxonomy()
function.
- $aAdditionalObjectTypes
array $aAdditionalObjectTypes Additional object types(post types) besides the caller
post type.
Since
2.0.0
3.1.1 Added the third parameter.
See
|
protected
|
#
setAuthorTableFilter( boolean $bEnableAuthorTableFileter = false )
Sets whether the author drop-down filter is enabled/disabled in the post type
post list table.
Sets whether the author drop-down filter is enabled/disabled in the post type
post list table.
Example
$this->setAuthorTableFilter( true );
Parameters
- $bEnableAuthorTableFileter
boolean If true, it enables the author filter; otherwise, it disables it.
Since
2.0.0
|
protected
|
#
setPostTypeArgs( array $aArgs )
Sets the post type arguments.
Sets the post type arguments.
This is only necessary if it is not set in the constructor.
Parameters
- $aArgs
array The array
of arguments to be passed to the second parameter of the
register_post_type() function.
Since
2.0.0
See
|
_isInThePage()
Methods inherited from AdminPageFramework_Factory_Controller
addHelpText()
,
addSettingField()
,
addSettingFields()
,
addSettingSection()
,
addSettingSections()
,
hasSettingNotice()
,
setFieldErrors()
,
setSettingNotice()
,
start()
Methods inherited from AdminPageFramework_Factory_View
_replyToGetFieldOutput()
,
_replyToPrintSettingNotice()
Methods inherited from AdminPageFramework_Factory_Model
_getFieldErrors()
,
_isValidationErrors()
,
_loadDefaultFieldTypeDefinitions()
,
_registerFields()
,
_replyToDeleteFieldErrors()
,
_replyToSaveFieldErrors()
,
_replyToSaveNotices()
,
_setUp()
Methods inherited from AdminPageFramework_Factory_Router
__call()
,
__get()
,
_getFormInstance()
,
_getHeadTagInstance()
,
_getHelpPaneInstance()
,
_getLinkInstancce()
,
_getPageLoadInfoInstance()
,
_isInstantiatable()
,
_replyToLoadComponents()
Magic methods summary
Properties summary
Properties inherited from AdminPageFramework_Factory_Router
$oProp