Admin Page Framework Documentation
  • Package
  • Class
  • Tree

Packages

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

Classes

  • AdminPageFramework_PostType
  • AdminPageFramework_PostType_Controller
  • 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 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( array $aSRCs, array $aCustomArgs = array() )

Enqueues styles of the given sources.

Parameters

$aSRCs
array
The sources of the stylesheet to enqueue: the url, the absolute file path, or the relative path to the root directory of WordPress. Example: array( '/css/mystyle.css', '/css/mystyle2.css' )
$aCustomArgs
array
(optional) The another source argument array.

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 of the given source.

Parameters

$sSRC
string
The source of the stylesheet to enqueue: the url, 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.

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 the after the input field tag.
  • attributes - (optional, array) [3.3.0+] attributes array. array( 'data-id' => '...' )

Returns

string
The style handle ID. If the passed url is not a valid url string, an empty string will be returned.
public array
# enqueueScripts( array $aSRCs, array $aCustomArgs = array() )

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

Parameters

$aSRCs
array
The sources of the stylesheets to enqueue: the URL, the absolute file path, or the relative path to the root directory of WordPress. Example: '/js/myscript.js'.
$aCustomArgs
array
(optional) Ad additional source list array.

Returns

array
An array holding the handle IDs of queued items.
public string
# enqueueScript( string $sSRC, array $aCustomArgs = array() )

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

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.

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.
  • attributes - (optional, array) [3.3.0+] attributes array. array( 'data-id' => '...' )

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

$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
  )
);

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.

Example

$this->setAuthorTableFilter( true );

Parameters

$bEnableAuthorTableFileter
boolean
$bEnableAuthorTableFileter 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.

Parameters

$aArguments
array
$aArguments 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.

Example

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

Parameters

$sHTML
string
$sHTML The HTML code to insert.
$bAppend
boolean
$bAppend 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.

Example

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

Parameters

$sHTML
string
$sHTML The HTML code to insert.
$bAppend
boolean
$bAppend 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_PostType_Model

__construct(), _registerTaxonomy(), _replyToDisableAutoSave(), _replyToRegisterPostType(), _replyToRegisterTaxonomies(), _replyToRemoveTexonomySubmenuPages(), _replyToSetColumnCell(), _replyToSetColumnHeader(), _replyToSetSortableColumns()

Methods inherited from AdminPageFramework_PostType_Router

__call(), _isInThePage()

Methods inherited from AdminPageFramework_Factory_Controller

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

Methods inherited from AdminPageFramework_Factory_View

_replyToGetFieldOutput(), _replyToPrintSettingNotice()

Methods inherited from AdminPageFramework_Factory_Model

_getFieldErrors(), _isValidationErrors(), _loadDefaultFieldTypeDefinitions(), _registerFields(), _replyToDeleteFieldErrors(), _replyToSaveFieldErrors(), _replyToSaveNotices(), _setLastInput(), _setUp(), getFieldErrors(), getSavedOptions(), validate()

Methods inherited from AdminPageFramework_Factory_Router

__get(), __toString(), _getFormInstance(), _getHelpPaneInstance(), _getLinkInstancce(), _getPageLoadInfoInstance(), _getResourceInstance(), _isInstantiatable(), _replyToLoadComponents()

Magic methods summary

Properties summary

Properties inherited from AdminPageFramework_Factory_Router

$oProp

Admin Page Framework Documentation generated by ApiGen 2.8.0