PHP Class Carbon_Fields\Container\Term_Meta_Container

Inheritance: extends Container
显示文件 Open project: htmlburger/carbon-fields

Public Properties

Property Type Description
$settings

Protected Properties

Property Type Description
$term_id

Public Methods

Method Description
__construct ( string $title ) Create a new term meta fields container
attach ( ) Add term meta for each of the container taxonomies
detach ( ) Revert the result of attach()
init ( ) Bind attach() and save() to the appropriate WordPress actions.
is_valid_attach ( ) : boolean Perform checks whether the container should be attached during the current request
is_valid_save ( integer $term_id = null ) : boolean Perform checks whether the current save() request is valid.
render ( $term = null ) Output the container markup
save ( integer $term_id ) Perform save operation after successful is_valid_save() check.
set_term_id ( integer $term_id ) Set the term ID the container will operate with.
show_on_level ( integer $term_level ) : object Show the container only on particular term level.
show_on_taxonomy ( string | array $taxonomies ) : object Show the container only on terms from the specified taxonomies.

Method Details

__construct() public method

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

attach() public method

Add term meta for each of the container taxonomies
public attach ( )

detach() public method

Revert the result of attach()
public detach ( )

init() public method

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

is_valid_attach() public method

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

is_valid_save() public method

Perform checks whether the current save() request is valid.
public is_valid_save ( integer $term_id = null ) : boolean
$term_id integer ID of the term against which save() is ran
return boolean

render() public method

Output the container markup
public render ( $term = null )

save() public method

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

set_term_id() public method

Set the term ID the container will operate with.
public set_term_id ( integer $term_id )
$term_id integer

show_on_level() public method

Show the container only on particular term level.
public show_on_level ( integer $term_level ) : object
$term_level integer
return object $this

show_on_taxonomy() public method

Show the container only on terms from the specified taxonomies.
public show_on_taxonomy ( string | array $taxonomies ) : object
$taxonomies string | array
return object $this

Property Details

$settings public_oe property

public $settings

$term_id protected_oe property

protected $term_id