PHP Class Themosis\Taxonomy\TaxField

Allow the user to add custom fields to a taxonomy.
Afficher le fichier Open project: themosis/framework

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
__construct ( string $taxonomySlug ) The TaxField constructor.
parse ( array $fields, string $taxonomySlug ) : array Parse the fields and mix them with a default one.

Method Details

addFields() public méthode

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

check() public méthode

If not, throw an exception.
public check ( )

delete() public méthode

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

editFields() public méthode

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

make() public static méthode

Init the custom taxonomy field.
public static make ( string $taxonomySlug ) : TaxField
$taxonomySlug string The taxonomy slug.
Résultat TaxField

save() public méthode

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

set() public méthode

Set the custom fields for the taxonomy.
public set ( array $fields ) : TaxField
$fields array A list of fields.
Résultat TaxField