PHP Класс Carbon_Fields\Container\Post_Meta_Container

Наследование: extends Container
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$settings array List of default container settings

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

Свойство Тип Описание
$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