PHP Класс Themosis\PostType\PostTypeBuilder

Наследование: implements Themosis\PostType\IPostType
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$action Themosis\Hook\IHook
$container Themosis\Foundation\Application Application container.
$datas Themosis\Foundation\DataContainer PostTypeData instance.
$filter Themosis\Hook\IHook
$metabox Themosis\Metabox\IMetabox The custom publish metabox.
$postType object | WP_Error The registered custom post type.
$prefix string Instance abstract name prefix for registration into the container.
$status array The custom statuses.
$view Illuminate\View\View The custom view used for publish metabox.

Открытые методы

Метод Описание
__construct ( Application $container, DataContainer $datas, Themosis\Metabox\IMetabox $metabox, Illuminate\View\View $view, Themosis\Hook\IHook $action, Themosis\Hook\IHook $filter ) Build a custom post type.
applyStatus ( string $value ) : mixed Apply the selected status to the post on save.
get ( null $property = null ) : array Return a defined post type property.
has_status ( ) : boolean Check if the custom post type has statuses registered.
instance ( ) : stdClass | WP_Post_type Return the WordPress post type instance.
make ( string $name, string $plural, string $singular ) : PostTypeBuilder Define a new custom post type.
register ( ) Triggered by the 'init' action event.
removeDefaultPublishBox ( ) Remove default publish metabox from the custom post type edit screen.
reorderStatusViews ( array $views ) : array Re-order the status views/links on top of the List Table.
set ( array $params = [] ) : PostTypeBuilder Set the custom post type. A user can also override the arguments by passing an array of custom post type arguments.
setTitle ( string $title ) : PostTypeBuilder Allow a user to change the title placeholder text.
status ( array | string $status, array $args = [] ) : PostTypeBuilder Add custom post type status.

Защищенные методы

Метод Описание
exposeStatuses ( ) Handle output of custom statuses to admin JS object.
setDefaultArguments ( string $plural, string $singular ) : array Set the custom post type default arguments.

Описание методов

__construct() публичный Метод

Build a custom post type.
public __construct ( Application $container, DataContainer $datas, Themosis\Metabox\IMetabox $metabox, Illuminate\View\View $view, Themosis\Hook\IHook $action, Themosis\Hook\IHook $filter )
$container Themosis\Foundation\Application The application container.
$datas Themosis\Foundation\DataContainer The post type properties.
$metabox Themosis\Metabox\IMetabox The custom metabox for custom publish metabox
$view Illuminate\View\View The view that handles custom publish metabox
$action Themosis\Hook\IHook The action class
$filter Themosis\Hook\IHook The filter class

applyStatus() публичный Метод

Apply the selected status to the post on save.
public applyStatus ( string $value ) : mixed
$value string The translated value by WordPress (is always "publish" for some reasons.)
Результат mixed

exposeStatuses() защищенный Метод

Handle output of custom statuses to admin JS object.
protected exposeStatuses ( )

get() публичный Метод

Return a defined post type property.
public get ( null $property = null ) : array
$property null
Результат array

has_status() публичный Метод

Check if the custom post type has statuses registered.
public has_status ( ) : boolean
Результат boolean

instance() публичный Метод

Return the WordPress post type instance.
public instance ( ) : stdClass | WP_Post_type
Результат stdClass | WP_Post_type if WordPress 4.6+

make() публичный Метод

Define a new custom post type.
public make ( string $name, string $plural, string $singular ) : PostTypeBuilder
$name string The post type slug name.
$plural string The post type plural name for display.
$singular string The post type singular name for display.
Результат PostTypeBuilder

register() публичный Метод

Register a WordPress custom post type.
public register ( )

removeDefaultPublishBox() публичный Метод

Remove default publish metabox from the custom post type edit screen.

reorderStatusViews() публичный Метод

If there is a 'trash' view, move it to last position for better user experience.
public reorderStatusViews ( array $views ) : array
$views array The statuses views.
Результат array

set() публичный Метод

Set the custom post type. A user can also override the arguments by passing an array of custom post type arguments.
public set ( array $params = [] ) : PostTypeBuilder
$params array The custom post type arguments.
Результат PostTypeBuilder

setDefaultArguments() защищенный Метод

Set the custom post type default arguments.
protected setDefaultArguments ( string $plural, string $singular ) : array
$plural string The post type plural display name.
$singular string The post type singular display name.
Результат array

setTitle() публичный Метод

Allow a user to change the title placeholder text.
public setTitle ( string $title ) : PostTypeBuilder
$title string The title placeholder text.
Результат PostTypeBuilder

status() публичный Метод

Add custom post type status.
public status ( array | string $status, array $args = [] ) : PostTypeBuilder
$status array | string The status key name.
$args array The status arguments.
Результат PostTypeBuilder

Описание свойств

$action защищенное свойство

protected IHook,Themosis\Hook $action
Результат Themosis\Hook\IHook

$container защищенное свойство

Application container.
protected Application,Themosis\Foundation $container
Результат Themosis\Foundation\Application

$datas защищенное свойство

PostTypeData instance.
protected DataContainer,Themosis\Foundation $datas
Результат Themosis\Foundation\DataContainer

$filter защищенное свойство

protected IHook,Themosis\Hook $filter
Результат Themosis\Hook\IHook

$metabox защищенное свойство

The custom publish metabox.
protected IMetabox,Themosis\Metabox $metabox
Результат Themosis\Metabox\IMetabox

$postType защищенное свойство

The registered custom post type.
protected object|WP_Error $postType
Результат object | WP_Error

$prefix защищенное свойство

Instance abstract name prefix for registration into the container.
protected string $prefix
Результат string

$status защищенное свойство

The custom statuses.
protected array $status
Результат array

$view защищенное свойство

The custom view used for publish metabox.
protected View,Illuminate\View $view
Результат Illuminate\View\View