PHP Класс Themosis\Taxonomy\TaxField

Allow the user to add custom fields to a taxonomy.
Показать файл Открыть проект

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

Метод Описание
addFields ( ) Display the custom fields on the add terms page.
check ( ) Check if the taxonomy exists. Call by the action hook 'wp_loaded'.
delete ( integer $term_id ) Delete the fields from the database.
editFields ( stdClass $term ) Display the custom fields on the edit term page.
make ( string $taxonomySlug ) : TaxField Init the custom taxonomy field.
save ( integer $term_id ) Save the fields values in the options table.
set ( array $fields ) : TaxField Set the custom fields for the taxonomy.

Приватные методы

Метод Описание
__construct ( string $taxonomySlug ) The TaxField constructor.
parse ( array $fields, string $taxonomySlug ) : array Parse the fields and mix them with a default one.

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

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

Display the custom fields on the add terms page.
public addFields ( )

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

If not, throw an exception.
public check ( )

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

Delete the fields from the database.
public delete ( integer $term_id )
$term_id integer The term ID.

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

Display the custom fields on the edit term page.
public editFields ( stdClass $term )
$term stdClass The term object passed by WordPress.

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

Init the custom taxonomy field.
public static make ( string $taxonomySlug ) : TaxField
$taxonomySlug string The taxonomy slug.
Результат TaxField

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

Save the fields values in the options table.
public save ( integer $term_id )
$term_id integer The term ID.

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

Set the custom fields for the taxonomy.
public set ( array $fields ) : TaxField
$fields array A list of fields.
Результат TaxField