PHP Класс Themosis\Taxonomy\TaxonomyBuilder

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

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

Свойство Тип Описание
$action Themosis\Hook\IHook
$container Themosis\Foundation\Application
$datas Themosis\Foundation\DataContainer Store the taxonomy data.
$fields array The taxonomy custom fields.
$prefix string
$validator Themosis\Validation\ValidationBuilder
$view Illuminate\View\Factory

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

Метод Описание
__construct ( Application $container, DataContainer $datas, Themosis\Hook\IHook $action, ValidationBuilder $validator, Illuminate\View\Factory $view ) Build a TaxonomyBuilder instance.
addFields ( array $fields, string $taxonomy = '' ) : TaxonomyBuilder Register/display taxonomy custom fields.
bind ( ) : TaxonomyBuilder Link the taxonomy to its custom post type. Allow the taxonomy to be found in 'parse_query' or 'pre_get_posts' filters.
displayAddFields ( ) Display fields on add form screen.
displayEditFields ( stdClass $term ) Display fields on edit form screen.
get ( null $property = null ) : array Return a defined taxonomy property.
make ( string $name, string | array $postType, string $plural, string $singular ) : TaxonomyBuilder
register ( ) Triggered by the 'init' action/event.
registerFields ( ) Register the term meta.
sanitize ( array $rules = [] ) : TaxonomyBuilder Sanitize custom fields values by using passed rules.
sanitizeField ( mixed $value, string $key, string $type ) : mixed Used to run the sanitize callbacks.
save ( integer $term_id ) Save term custom field data to database.
set ( array $params = [] ) : TaxonomyBuilder Set the custom taxonomy. A user can also override the arguments by passing an array of taxonomy arguments.

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

Метод Описание
getValue ( integer $term_id, Themosis\Field\Fields\IField $field, string $value = '' ) : mixed | string Return a default value for the custom fields.
setDefaultArguments ( array $posttypes, string $plural, string $singular ) : array Set the taxonomy default arguments.
setNonce ( ) Set a custom nonce.

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

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

Build a TaxonomyBuilder instance.
public __construct ( Application $container, DataContainer $datas, Themosis\Hook\IHook $action, ValidationBuilder $validator, Illuminate\View\Factory $view )
$container Themosis\Foundation\Application
$datas Themosis\Foundation\DataContainer The taxonomy properties.
$action Themosis\Hook\IHook
$validator Themosis\Validation\ValidationBuilder
$view Illuminate\View\Factory

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

Can be called without the need to create a custom taxonomy previously (pass taxonomy name as second parameter to the method).
public addFields ( array $fields, string $taxonomy = '' ) : TaxonomyBuilder
$fields array A list of custom fields to use.
$taxonomy string The taxonomy name used to attach the fields to.
Результат TaxonomyBuilder

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

Link the taxonomy to its custom post type. Allow the taxonomy to be found in 'parse_query' or 'pre_get_posts' filters.
public bind ( ) : TaxonomyBuilder
Результат TaxonomyBuilder

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

Display fields on add form screen.
public displayAddFields ( )

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

Display fields on edit form screen.
public displayEditFields ( stdClass $term )
$term stdClass The term object

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

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

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

Return a default value for the custom fields.
protected getValue ( integer $term_id, Themosis\Field\Fields\IField $field, string $value = '' ) : mixed | string
$term_id integer
$field Themosis\Field\Fields\IField
$value string
Результат mixed | string

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

public make ( string $name, string | array $postType, string $plural, string $singular ) : TaxonomyBuilder
$name string The taxonomy slug name.
$postType string | array The taxonomy object type slug: 'post', 'page', ...
$plural string The taxonomy plural display name.
$singular string The taxonomy singular display name.
Результат TaxonomyBuilder

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

Register the custom taxonomy.
public register ( )

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

Register the term meta.
public registerFields ( )

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

Sanitize custom fields values by using passed rules.
public sanitize ( array $rules = [] ) : TaxonomyBuilder
$rules array Sanitize rules.
Результат TaxonomyBuilder

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

Used to run the sanitize callbacks.
public sanitizeField ( mixed $value, string $key, string $type ) : mixed
$value mixed
$key string
$type string
Результат mixed

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

Save term custom field data to database.
public save ( integer $term_id )
$term_id integer

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

Set the custom taxonomy. A user can also override the arguments by passing an array of taxonomy arguments.
public set ( array $params = [] ) : TaxonomyBuilder
$params array Taxonomy arguments to override defaults.
Результат TaxonomyBuilder

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

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

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

Set a custom nonce.
protected setNonce ( )

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

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

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

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

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

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

Store the taxonomy data.
protected DataContainer,Themosis\Foundation $datas
Результат Themosis\Foundation\DataContainer

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

The taxonomy custom fields.
protected array $fields
Результат array

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

protected string $prefix
Результат string

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

protected ValidationBuilder,Themosis\Validation $validator
Результат Themosis\Validation\ValidationBuilder

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

protected Factory,Illuminate\View $view
Результат Illuminate\View\Factory