PHP 클래스 Themosis\Taxonomy\TaxonomyBuilder

상속: extends Themosis\Field\Wrapper
파일 보기 프로젝트 열기: themosis/framework

보호된 프로퍼티들

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