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.
Abstract
Package: AdminPageFramework\Factory\PostType
Since: 3.0.4
Located at factory/post_type/AdminPageFramework_PostType_Controller.php
Package: AdminPageFramework\Factory\PostType
Since: 3.0.4
Located at factory/post_type/AdminPageFramework_PostType_Controller.php
Methods summary
public
|
#
setUp( )
The method for necessary set-ups. Examplepublic function setUp() { $this->setAutoSave( false ); $this->setAuthorTableFilter( true ); $this->addTaxonomy( 'sample_taxonomy', // taxonomy slug array( // argument - for the argument array keys, refer to : http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments '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, // framework specific key 'show_in_sidebar_menus' => false, // framework specific key ) ); } Since
2.0.0
Callback
action init
Remark
The user should override this method in their class definition.
A callback for the wp_loaded hook.Overrides |
public
|
|
public
array
|
#
enqueueStyles( )
Enqueues styles of the given sources. Returnsarray An array holding the handle IDs of queued items. Since
3.0.0
3.8.31 Removed parameters to be compatible with the base class. |
public
string
|
#
enqueueStyle( )
Enqueues a style of the given source. Returnsstring The added resource handle iD. Since
3.0.0
3.8.31 Removed parameters to be compatible with the base class. |
public
array
|
#
enqueueScripts( )
Enqueues scripts by the given sources. Example$this->enqueueScripts( array( plugins_url( 'asset/js/test.js' , __FILE__ ), // source url or path plugins_url( 'asset/js/test2.js' , __FILE__ ), ) ); Returnsarray An array holding the handle IDs of queued items. Since
3.0.0
3.8.31 Removed parameters to be compatible with the base class. |
public
string
|
#
enqueueScript( )
Enqueues a script by the given source. Example$this->enqueueScript( plugins_url( 'asset/js/test.js' , __FILE__ ), // source url or path array( 'handle_id' => 'my_script', // this handle ID also is used as the object name for the translation array below. 'translation' => array( 'a' => 'hello world!', 'style_handle_id' => $sStyleHandle, // check the enqueued style handle ID here. ), ) ); Returnsstring The added resource handle iD. Since
3.0.0
3.8.31 Removed parameters to be compatible with the base class. |
protected
|
#
setAutoSave( boolean $bEnableAutoSave = True )
Enables or disables the auto-save feature in the custom post type's post submission page. Example$this->setAutoSave( false ); Parameters
Since
2.0.0
|
protected
|
#
addTaxonomy( string $sTaxonomySlug, array $aArguments, array $aAdditionalObjectTypes = array() )
Adds a custom taxonomy to the class post type.
Example$this->addTaxonomy( 'sample_taxonomy', // taxonomy slug array( // argument '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, // framework specific key 'show_in_sidebar_menus' => false, // framework specific key ) ); Parameters
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. Example$this->setAuthorTableFilter( true ); Parameters
Since
2.0.0
|
protected
|
#
setArguments( array $aArguments = array() )
Sets the post type arguments. Parameters
Since
3.2.0
SeeRemark
The alias of
setPostTypeArgs() . |