PHP Class Taxonomy_Core

Author: Justin Sternberg Text Domain: taxonomy-core Domain Path: /languages
Show file Open project: webdevstudios/taxonomy_core Class Usage Examples

Protected Properties

Property Type Description
$arg_overrides array Optional argument overrides passed in from the constructor.
$l10n_done boolean Whether text-domain has been registered
$object_types array Objects to register this taxonomy against
$plural string Plural Taxonomy label
$singular string Singlur Taxonomy label
$taxonomies array An array of each Taxonomy_Core object registered with this class
$taxonomy string Registered Taxonomy name/slug
$taxonomy_args array All Taxonomy registration arguments

Public Methods

Method Description
__construct ( mixed $taxonomy, array $arg_overrides = [], array $object_types = ['post'] ) Constructor. Builds our Taxonomy.
__toString ( ) : string Magic method that echos the Taxonomy registered name when treated like a string
get_args ( ) : array Gets the passed in arguments combined with our defaults.
l10n ( ) Load this library's text domain
register_taxonomy ( ) Actually registers our Taxonomy with the merged arguments
taxonomies ( string $taxonomy = '' ) : mixed Provides access to all Taxonomy_Core taxonomy objects registered via this class.
taxonomy ( string $key = 'taxonomy' ) : mixed Provides access to protected class properties.

Method Details

__construct() public method

Constructor. Builds our Taxonomy.
Since: 0.1.0
public __construct ( mixed $taxonomy, array $arg_overrides = [], array $object_types = ['post'] )
$taxonomy mixed Singular Taxonomy name, or array with Singular, Plural, and Registered
$arg_overrides array Taxonomy registration override arguments
$object_types array Post types to register this taxonomy for

__toString() public method

Magic method that echos the Taxonomy registered name when treated like a string
Since: 0.1.0
public __toString ( ) : string
return string Taxonomy registered name

get_args() public method

Gets the passed in arguments combined with our defaults.
Since: 0.1.0
public get_args ( ) : array
return array Taxonomy arguments array

l10n() public method

Load this library's text domain
Since: 0.2.0
public l10n ( )

register_taxonomy() public method

Actually registers our Taxonomy with the merged arguments
Since: 0.1.0
public register_taxonomy ( )

taxonomies() public static method

Provides access to all Taxonomy_Core taxonomy objects registered via this class.
Since: 0.1.0
public static taxonomies ( string $taxonomy = '' ) : mixed
$taxonomy string Specific Taxonomy_Core object to return, or 'true' to specify only names.
return mixed Specific Taxonomy_Core object or array of all

taxonomy() public method

Provides access to protected class properties.
Since: 0.1.0
public taxonomy ( string $key = 'taxonomy' ) : mixed
$key string Specific taxonomy parameter to return
return mixed Specific taxonomy parameter or array of singular, plural and registered name

Property Details

$arg_overrides protected property

Optional argument overrides passed in from the constructor.
protected array $arg_overrides
return array

$l10n_done protected static property

Whether text-domain has been registered
protected static bool $l10n_done
return boolean

$object_types protected property

Objects to register this taxonomy against
protected array $object_types
return array

$plural protected property

Plural Taxonomy label
protected string $plural
return string

$singular protected property

Singlur Taxonomy label
protected string $singular
return string

$taxonomies protected static property

An array of each Taxonomy_Core object registered with this class
protected static array $taxonomies
return array

$taxonomy protected property

Registered Taxonomy name/slug
protected string $taxonomy
return string

$taxonomy_args protected property

All Taxonomy registration arguments
protected array $taxonomy_args
return array