Filter: clarkson_term_types

apply_filters( 'clarkson_term_types', $typse, $term ) → {array}

Allows the theme to overwrite classes to look for when creating an object.
Parameters:
Name Type Description
$typse array Sanitized class names to load.
$term WP_Term Term which we are trying to convert into an object.
Since:
  • 1.0.0
Source:
Returns:
Class names to search for.
Type
array
Example
// load a different class instead of what Clarkson Core calculates.
add_filter( 'clarkson_term_types', function( $types, $term ) {
 if ( $term->taxonomy === 'gm_category' ){
     array_unshift($types, self::OBJECT_CLASS_NAMESPACE . 'custom_taxonomy_class';
 }
 return $types;
}, 10, 2 );