PHP 클래스 Carbon_Fields\Container\Post_Meta_Container

상속: extends Container
파일 보기 프로젝트 열기: htmlburger/carbon-fields

공개 프로퍼티들

프로퍼티 타입 설명
$settings array List of default container settings

보호된 프로퍼티들

프로퍼티 타입 설명
$post_id integer ID of the post the container is working with

공개 메소드들

메소드 설명
__construct ( string $title ) Create a new post meta fields container
attach ( ) Add meta box for each of the container post types
check_setup_settings ( array &$settings = [] ) Check if all required container settings have been specified
detach ( ) Revert the result of attach()
hide_on_template ( string | array $template_path ) : object Hide the container from pages whose template has filename $template_path.
init ( ) Create DataStore instance, set post ID to operate with (if such exists).
is_valid_attach ( ) : boolean Perform checks whether the container should be attached during the current request
is_valid_save ( integer $post_id ) : boolean Perform checks whether the current save() request is valid Possible errors are triggering save() for autosave requests or performing post save outside of the post edit page (like Quick Edit)
is_valid_save_conditions ( integer $post_id ) : boolean Perform checks whether the current save() request is valid Possible errors are triggering save() for autosave requests or performing post save outside of the post edit page (like Quick Edit)
postbox_classes ( $classes ) Classes to add to the post meta box
render ( ) Output the container markup
save ( integer $post_id ) Perform save operation after successful is_valid_save() check.
set_context ( string $context ) Sets the meta box container context
set_post_id ( integer $post_id ) Set the post ID the container will operate with.
set_priority ( string $priority ) Sets the meta box container priority
show_on_category ( string $category_slug ) : object Show the container only on posts from the specified category.
show_on_level ( integer $level ) : object Show the container only on hierarchical posts of level $level.
show_on_page ( integer | string $page ) : object Show the container only on particular page referenced by it's path.
show_on_page_children ( string $parent_page_path ) : object Show the container only on pages whose parent is referenced by $parent_page_path.
show_on_post_format ( string | array $post_format ) : object Show the container only on posts from the specified format.
show_on_post_type ( string | array $post_types ) : object Show the container only on posts from the specified type(s).
show_on_taxonomy_term ( string $term_slug, string $taxonomy_slug ) : object Show the container only on posts which have term $term_slug from the $taxonomy_slug taxonomy.
show_on_template ( string | array $template_path ) : object Show the container only on pages whose template has filename $template_path.

메소드 상세

__construct() 공개 메소드

Create a new post meta fields container
public __construct ( string $title )
$title string Unique title of the container

attach() 공개 메소드

Add meta box for each of the container post types
public attach ( )

check_setup_settings() 공개 메소드

Check if all required container settings have been specified
public check_setup_settings ( array &$settings = [] )
$settings array Container settings

detach() 공개 메소드

Revert the result of attach()
public detach ( )

hide_on_template() 공개 메소드

Hide the container from pages whose template has filename $template_path.
public hide_on_template ( string | array $template_path ) : object
$template_path string | array
리턴 object $this

init() 공개 메소드

Bind attach() and save() to the appropriate WordPress actions.
public init ( )

is_valid_attach() 공개 메소드

Perform checks whether the container should be attached during the current request
public is_valid_attach ( ) : boolean
리턴 boolean True if the container is allowed to be attached

is_valid_save() 공개 메소드

Perform checks whether the current save() request is valid Possible errors are triggering save() for autosave requests or performing post save outside of the post edit page (like Quick Edit)
또한 보기: is_valid_save_conditions()
public is_valid_save ( integer $post_id ) : boolean
$post_id integer ID of the post against which save() is ran
리턴 boolean

is_valid_save_conditions() 공개 메소드

Perform checks whether the current save() request is valid Possible errors are triggering save() for autosave requests or performing post save outside of the post edit page (like Quick Edit)
public is_valid_save_conditions ( integer $post_id ) : boolean
$post_id integer ID of the post against which save() is ran
리턴 boolean

postbox_classes() 공개 메소드

Classes to add to the post meta box
public postbox_classes ( $classes )

render() 공개 메소드

Output the container markup
public render ( )

save() 공개 메소드

The call is propagated to all fields in the container.
public save ( integer $post_id )
$post_id integer ID of the post against which save() is ran

set_context() 공개 메소드

Sets the meta box container context
또한 보기: https://codex.wordpress.org/Function_Reference/add_meta_box
public set_context ( string $context )
$context string ('normal', 'advanced' or 'side')

set_post_id() 공개 메소드

Set the post ID the container will operate with.
public set_post_id ( integer $post_id )
$post_id integer

set_priority() 공개 메소드

Sets the meta box container priority
또한 보기: https://codex.wordpress.org/Function_Reference/add_meta_box
public set_priority ( string $priority )
$priority string ('high', 'core', 'default' or 'low')

show_on_category() 공개 메소드

Show the container only on posts from the specified category.
또한 보기: show_on_taxonomy_term()
public show_on_category ( string $category_slug ) : object
$category_slug string
리턴 object $this

show_on_level() 공개 메소드

Levels start from 1 (top level post)
public show_on_level ( integer $level ) : object
$level integer
리턴 object $this

show_on_page() 공개 메소드

Show the container only on particular page referenced by it's path.
public show_on_page ( integer | string $page ) : object
$page integer | string page ID or page path
리턴 object $this

show_on_page_children() 공개 메소드

Show the container only on pages whose parent is referenced by $parent_page_path.
public show_on_page_children ( string $parent_page_path ) : object
$parent_page_path string
리턴 object $this

show_on_post_format() 공개 메소드

Learn more about {@link http://codex.wordpress.org/Post_Formats Post Formats (Codex)}
public show_on_post_format ( string | array $post_format ) : object
$post_format string | array Name of the format as listed on Codex
리턴 object $this

show_on_post_type() 공개 메소드

Show the container only on posts from the specified type(s).
public show_on_post_type ( string | array $post_types ) : object
$post_types string | array
리턴 object $this

show_on_taxonomy_term() 공개 메소드

Show the container only on posts which have term $term_slug from the $taxonomy_slug taxonomy.
public show_on_taxonomy_term ( string $term_slug, string $taxonomy_slug ) : object
$term_slug string
$taxonomy_slug string
리턴 object $this

show_on_template() 공개 메소드

Show the container only on pages whose template has filename $template_path.
public show_on_template ( string | array $template_path ) : object
$template_path string | array
리턴 object $this

프로퍼티 상세

$post_id 보호되어 있는 프로퍼티

ID of the post the container is working with
또한 보기: init()
protected int $post_id
리턴 integer

$settings 공개적으로 프로퍼티

List of default container settings
또한 보기: init()
public array $settings
리턴 array