PHP Class Papi_Entry_Type, papi

Inheritance: extends Papi_Core_Type
Datei anzeigen Open project: wp-papi/papi Class Usage Examples

Public Properties

Property Type Description
$show_help_tabs Show help tabs.
$show_screen_options boolean Show screen options.
$type string The type name.

Protected Properties

Property Type Description
$boxes array The array of meta boxes to register.
$load_boxes boolean Load all boxes.

Public Methods

Method Description
add_help_tabs ( ) Add help tabs.
body_classes ( ) : array Get custom admin body classes.
get_body_classes ( ) : array Get admin body css classes.
get_boxes ( ) : array Get boxes from the page type.
get_labels ( ) : array Get labels that should be changed when using fill_labels option.
get_properties ( ) : array Get root properties.
get_property ( string $slug, string $child_slug = '' ) : Papi_Property Get property from entry type.
help ( ) : array Add admin help tabs.
help_sidebar ( ) : boolean Add help sidebar content.
setup ( ) Setup entry type.
singleton ( ) : boolean Check if the entry type is a singleton.

Protected Methods

Method Description
box ( mixed $file_or_options = [], array $properties = [] ) Add new meta box with properties.
call_parent_register ( ) Call parent register if it exists to collect boxes on the parent entry type.
convert_properties ( array | object $properties ) : array Convert properties to properties objects.
merge_boxes ( array $boxes ) : array Merge boxes with same title.
property ( array | string $file_or_options = [], array $values = [] ) : null | Papi_Property Add new property to the page using array or rendering property template file.
tab ( mixed $file_or_options = [], array $properties = [] ) : null | Papi_Core_Tab Add a new tab.
template ( string $file, array $values = [] ) : array Load template file.

Method Details

add_help_tabs() public method

Add help tabs.
public add_help_tabs ( )

body_classes() public method

Get custom admin body classes.
public body_classes ( ) : array
return array

box() protected method

Add new meta box with properties.
protected box ( mixed $file_or_options = [], array $properties = [] )
$file_or_options mixed
$properties array

call_parent_register() protected method

Call parent register if it exists to collect boxes on the parent entry type.
protected call_parent_register ( )

convert_properties() protected method

Convert properties to properties objects.
protected convert_properties ( array | object $properties ) : array
$properties array | object
return array

get_body_classes() public method

Use body_classes method to add custom admin body classes.
public get_body_classes ( ) : array
return array

get_boxes() public method

Get boxes from the page type.
public get_boxes ( ) : array
return array

get_labels() public method

Get labels that should be changed when using fill_labels option.
public get_labels ( ) : array
return array

get_properties() public method

Get root properties.
public get_properties ( ) : array
return array

get_property() public method

Get property from entry type.
public get_property ( string $slug, string $child_slug = '' ) : Papi_Property
$slug string
$child_slug string
return Papi_Property

help() public method

Example: 'My custom title' => 'My custom content'
public help ( ) : array
return array

help_sidebar() public method

By default we return false to disable the sidebar content.
public help_sidebar ( ) : boolean
return boolean

merge_boxes() protected method

Merge boxes with same title.
protected merge_boxes ( array $boxes ) : array
$boxes array
return array

property() protected method

Add new property to the page using array or rendering property template file.
protected property ( array | string $file_or_options = [], array $values = [] ) : null | Papi_Property
$file_or_options array | string
$values array
return null | Papi_Property

setup() public method

Setup entry type.
public setup ( )

singleton() public method

Check if the entry type is a singleton.
public singleton ( ) : boolean
return boolean

tab() protected method

Add a new tab.
protected tab ( mixed $file_or_options = [], array $properties = [] ) : null | Papi_Core_Tab
$file_or_options mixed
$properties array
return null | Papi_Core_Tab

template() protected method

Load template file.
protected template ( string $file, array $values = [] ) : array
$file string
$values array
return array

Property Details

$boxes protected_oe property

The array of meta boxes to register.
protected array $boxes
return array

$load_boxes protected_oe property

Load all boxes.
protected bool $load_boxes
return boolean

$show_help_tabs public_oe property

Show help tabs.
public $show_help_tabs

$show_screen_options public_oe property

Show screen options.
public bool $show_screen_options
return boolean

$type public_oe property

The type name.
public string $type
return string