Admin Page Framework Documentation
  • Package
  • Class
  • Tree

Packages

  • AdminPageFramework
    • Factory
    • FieldType
    • MetaBox
    • NetworkAdmin
      • Page
    • Page
    • PageMetaBox
    • PostType
    • TaxonomyField
    • Widget

Classes

  • AdminPageFramework_PostType
  • AdminPageFramework_PostType_Controller
  • AdminPageFramework_PostType_Model
  • AdminPageFramework_PostType_Router
  • AdminPageFramework_PostType_View

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
Extended by AdminPageFramework_Factory_Model
Extended by AdminPageFramework_Factory_View
Extended by AdminPageFramework_Factory_Controller
Extended by AdminPageFramework_Factory
Extended by AdminPageFramework_PostType_Router
Extended by AdminPageFramework_PostType_Model
Extended by AdminPageFramework_PostType_View
Extended by AdminPageFramework_PostType_Controller

Direct known subclasses

AdminPageFramework_PostType

Abstract
Package: AdminPageFramework\PostType
Since: 3.0.4
Located at factory/AdminPageFramework_PostType/AdminPageFramework_PostType_Controller.php

Methods summary

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', // 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

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
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

http://codex.wordpress.org/Function_Reference/wp_enqueue_style

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__ ), // 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.
),
)
);

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

http://codex.wordpress.org/Function_Reference/wp_enqueue_script

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', // 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
  )
);
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

$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

http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments
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
# setArguments( array $aArguments = array() )

Sets the post type arguments.

Sets the post type arguments.

Parameters

$aArguments
array
The array of arguments to be passed to the second parameter of the register_post_type() function.

Since

3.2.0

See

http://codex.wordpress.org/Function_Reference/register_post_type#Arguments

Remark

The alias of setPostTypeArgs().
protected
# setFooterInfoLeft( string $sHTML, boolean $bAppend = true )

Sets the given HTML text into the footer on the left hand side.

Sets the given HTML text into the footer on the left hand side.

Example

$this->setFooterInfoLeft( '<br />Custom Text on the left hand side.' );

Parameters

$sHTML
string
The HTML code to insert.
$bAppend
boolean
If true, the text will be appended; otherwise, it will replace the default text.

Since

2.0.0
protected
# setFooterInfoRight( string $sHTML, boolean $bAppend = true )

Sets the given HTML text into the footer on the right hand side.

Sets the given HTML text into the footer on the right hand side.

Example

$this->setFooterInfoRight( '<br />Custom Text on the right hand side.' );

Parameters

$sHTML
string
The HTML code to insert.
$bAppend
boolean
If true, the text will be appended; otherwise, it will replace the default text.

Since

2.0.0

Methods inherited from AdminPageFramework_PostType_View

_replyToFilterPostTypeContent(), content()

Methods inherited from AdminPageFramework_Factory_Controller

addHelpText(), addSettingField(), addSettingFields(), addSettingSection(), addSettingSections(), hasSettingNotice(), setFieldErrors(), setSettingNotice()

Methods inherited from AdminPageFramework_Factory_View

__construct(), _replyToGetFieldOutput(), _replyToPrintSettingNotice()

Methods inherited from AdminPageFramework_Factory_Model

_setUp()

Methods inherited from AdminPageFramework_Factory_Router

__call(), __get(), _getFormInstance(), _getHeadTagInstance(), _getHelpPaneInstance(), _getLinkInstancce(), _getPageLoadInfoInstance(), _isInThePage(), _isInstantiatable(), _replyToLoadComponents()

Magic methods summary

Properties summary

Properties inherited from AdminPageFramework_Factory_Router

$oProp

Admin Page Framework Documentation API documentation generated by ApiGen 2.8.0