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

Provides methods for registering custom post types.

Hooks

The class automatically creates WordPress action and filter hooks associated with the class methods. The class methods corresponding to the name of the below actions and filters can be extended to modify the page output. Those methods are the callbacks of the filters and actions.

Methods and Action Hooks

  • start_{instantiated class name} – triggered at the end of the class constructor. This receives the class object in the first parameter.
  • set_up_{instantiated class name} – triggered after the setUp() method is called. This receives the class object in the first parameter.

Methods and Filter Hooks

  • cell_{post type slug}_{column key} – receives the output string for the listing table of the custom post type's post. The first parameter: output string. The second parameter: the post ID.
  • columns_{post type slug} – receives the array containing the header columns for the listing table of the custom post type's post. The first parameter: the header columns container array.
  • sortable_columns_{post type slug} – receives the array containing the sortable header column array for the listing table of the custom post type's post. The first parameter: the sortable header columns container array.

Remarks

The slugs must not contain a dot(.) or a hyphen(-) since it is used in the callback method name.

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
Extended by AdminPageFramework_PostType
Abstract
Package: AdminPageFramework\PostType
Since: 2.0.0
Located at factory/AdminPageFramework_PostType/AdminPageFramework_PostType.php

Methods summary

public
# __construct( string $sPostType, array $aArgs = array(), string $sCallerPath = null, string $sTextDomain = 'admin-page-framework' )

The constructor of the class object.

The constructor of the class object.

Registers necessary hooks and sets up internal properties.

Example

new APF_PostType(
    'apf_posts',     // post type slug
    array( // argument - for the array structure, refer to http://codex.wordpress.org/Function_Reference/register_post_type#Arguments
        'labels' => array(
            'name' => 'Admin Page Framework',
            'singular_name' => 'Admin Page Framework',
            'add_new' => 'Add New',
            'add_new_item' => 'Add New APF Post',
            'edit' => 'Edit',
            'edit_item' => 'Edit APF Post',
            'new_item' => 'New APF Post',
            'view' => 'View',
            'view_item' => 'View APF Post',
            'search_items' => 'Search APF Post',
            'not_found' => 'No APF Post found',
            'not_found_in_trash' => 'No APF Post found in Trash',
            'parent' => 'Parent APF Post'
        ),
        'public' => true,
        'menu_position' => 110,
        'supports' => array( 'title' ),
        'taxonomies' => array( '' ),
        'menu_icon' => null,
        'has_archive' => true,
        'show_admin_column' => true, // for custom taxonomies
    )
);

Parameters

$sPostType
string
The post type slug.
$aArgs
array
The argument array passed to register_post_type().
$sCallerPath
string
The path of the caller script. This is used to retrieve the script information to insert it into the footer. If not set, the framework tries to detect it.
$sTextDomain
string
The text domain of the caller script.

Since

2.0.0
2.1.6 Added the $sTextDomain parameter.

See

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

Methods inherited from AdminPageFramework_PostType_Controller

addTaxonomy(), enqueueScript(), enqueueScripts(), enqueueStyle(), enqueueStyles(), setArguments(), setAuthorTableFilter(), setAutoSave(), setFooterInfoLeft(), setFooterInfoRight(), setUp()

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

_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