PHP 클래스 Themosis\PostType\PostTypeBuilder

상속: implements Themosis\PostType\IPostType
파일 보기 프로젝트 열기: themosis/framework

보호된 프로퍼티들

프로퍼티 타입 설명
$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