Filter
rpress_get_taxonomy_labels
On this page
Filters the name labels returned for a menu taxonomy.
Runs at the end of rpress_get_taxonomy_labels() with the array of 'name', 'singular_name' and 'menu_name' labels read from the registered taxonomy. The array is empty when the taxonomy is not registered.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$labels | array | Array with 'name', 'singular_name' and 'menu_name'. |
$taxonomy | WP_Taxonomy|false | The taxonomy object returned by get_taxonomy(), or false when it is not registered. |
Return value#
array. The labels array.
Example#
add_filter( 'rpress_get_taxonomy_labels', 'my_taxonomy_menu_label', 10, 2 );
function my_taxonomy_menu_label( $labels, $taxonomy ) {
if ( $taxonomy && 'addon_category' === $taxonomy->name ) {
$labels['menu_name'] = __( 'Extras', 'my-plugin' );
}
return $labels;
}
Notes#
The $taxonomy argument is the taxonomy object, not the slug the function was called with.
Source#
Applied in:
includes/post-types.php(line 401), inrpress_get_taxonomy_labels()
See also#
Was this page helpful?
