apply_filters( 'clarkson_taxonomy_class', $type, $taxonomy ) → {null|string}
Allows the theme to overwrite class that is going to be used to create a taxonomy object.
Parameters:
Name | Type | Description |
---|---|---|
$type |
null | string | Sanitized class name. |
$taxonomy |
WP_Taxonomy | The original taxonomy object. |
- Since:
- 1.0.0
- Source:
Returns:
Class name of taxonomy to be created.
- Type
- null | string
Example
// load a different class instead of what Clarkson Core calculates.
add_filter( 'clarkson_taxonomy_class', function( $type, $taxonomy ) {
if ( $taxonomy->name === 'example' ){
$type = self::OBJECT_CLASS_NAMESPACE . 'custom_taxonomy_class';
}
return $type;
}, 10, 2 );