PHP Class Papi_Core_Type, papi

显示文件 Open project: wp-papi/papi Class Usage Examples

Public Properties

Property Type Description
$name string The name of the core type.
$sort_order integer The sort order of the core type.
$type string The type name. Used for WP CLI.

Protected Properties

Property Type Description
$_class_name string The page type class name.
$_file_path string The file path of the core type file.

Public Methods

Method Description
__construct ( string $file_path = '' ) The constructor.
allowed ( ) : boolean Determine if the entry type is allowed.
boot ( ) Boot page type.
get_class_name ( ) : string Get the page type class name with namespace if exists.
get_file_path ( ) : string Get the page type file pat.h
get_id ( ) : string Get the page type identifier.
get_type ( ) : string Get type name.
has_name ( ) : boolean Check so we have a name on the page type.
match_id ( string $id ) : boolean Check if the the given identifier match the page type identifier.
new_class ( ) : null | object Create a new instance of the page type file.

Protected Methods

Method Description
get_meta ( ) : array Get meta data from type class and merge with the parent meta data.
setup_actions ( ) Setup actions.
setup_file ( string $file_path ) Load the file and setup file path, file name and class name properties.
setup_filters ( ) Setup filters.
setup_meta_data ( ) Setup meta data.

Method Details

__construct() public method

Load a core type by the file.
public __construct ( string $file_path = '' )
$file_path string

allowed() public method

Determine if the entry type is allowed.
public allowed ( ) : boolean
return boolean

boot() public method

Boot page type.
public boot ( )

get_class_name() public method

Get the page type class name with namespace if exists.
public get_class_name ( ) : string
return string

get_file_path() public method

Get the page type file pat.h
public get_file_path ( ) : string
return string

get_id() public method

Get the page type identifier.
public get_id ( ) : string
return string

get_meta() protected method

Get meta data from type class and merge with the parent meta data.
protected get_meta ( ) : array
return array

get_type() public method

Get type name.
public get_type ( ) : string
return string

has_name() public method

Check so we have a name on the page type.
public has_name ( ) : boolean
return boolean

match_id() public method

Check if the the given identifier match the page type identifier.
public match_id ( string $id ) : boolean
$id string
return boolean

new_class() public method

Create a new instance of the page type file.
public new_class ( ) : null | object
return null | object

setup_actions() protected method

Setup actions.
protected setup_actions ( )

setup_file() protected method

Load the file and setup file path, file name and class name properties.
protected setup_file ( string $file_path )
$file_path string

setup_filters() protected method

Setup filters.
protected setup_filters ( )

setup_meta_data() protected method

Setup meta data.
protected setup_meta_data ( )

Property Details

$_class_name protected_oe property

The page type class name.
protected string $_class_name
return string

$_file_path protected_oe property

The file path of the core type file.
protected string $_file_path
return string

$name public_oe property

The name of the core type.
public string $name
return string

$sort_order public_oe property

The sort order of the core type.
public int $sort_order
return integer

$type public_oe property

The type name. Used for WP CLI.
public string $type
return string