Notice: There is no legacy documentation available for this item, so you are seeing the current documentation.
Purpose & version added
This filter can be used to manage the public taxonomies.
Arguments (1)
- $taxonomies (array) – A list of roles being ignored.
- $namesOnly (bool) – Whether only the names should be returned.
Example code snippet
The code snippet below is just an example of how this filter can be used. In the example below, we’ll remove the genre taxonomy from the public taxonomies list.
// Removes the genre taxonomy from the public taxonomies list.
add_filter( 'aioseo_public_taxonomies', 'aioseo_filter_public_taxonomies' );
function aioseo_filter_public_taxonomies( $taxonomies ) {
$filteredTaxonomies = [];
foreach ( $taxonomies as $taxonomiesObject ) {
if ( 'genre' === $taxonomiesObject['name'] ) {
continue;
}
$filteredTaxonomies[] = $taxonomiesObject;
}
return $filteredTaxonomies;
}
Changelog
Version | Description |
4.1.6 | Introduced. |