guideplugin/guide/taxonomies
Adjust the included or excluded term IDs for guides
guideplugin/guide/taxonomies
Definition
With this filter you can adjust the included or excluded term IDs.
This filter allows you to control which taxonomy terms are included or excluded in a specific guide.
Parameters
apply_filters('guideplugin/guide/taxonomies', $taxonomy_settings, $guide_id);
Parameter | Type | Description |
---|---|---|
$taxonomy_settings | array | This array contains the information to include or exclude taxonomies |
$guide_id | int | The ID of the guide |
Taxonomy Settings Structure
The $taxonomy_settings
array looks like this:
$taxonomy_settings = array(
'option' => 'include', // Include or exclude taxonomies?
'selection' => [12, 124], // The term_taxonomy_id
);
Example
The example shows you how to adjust the included or excluded term IDs:
<?php
function my_guide_taxonomies($taxonomy_settings, $guide_id) {
if ($guide_id == 24) { // The guide you want to modify
array_push($taxonomy_settings['selection'], 14); // Add term ID 14 to the taxonomy selection
}
return $taxonomy_settings;
}
add_filter('guideplugin/guide/taxonomies', 'my_guide_taxonomies', 10, 2);
Usage Scenarios
Dynamic Terms
Add specific categories or tags based on guide context
Conditional Logic
Include/exclude terms based on guide ID or user roles
Content Curation
Fine-tune which taxonomy terms appear in guides