Taxonomies
Overview
Manage inherited access rules for an entire registered taxonomy. Select the subject with AAM::api()->taxonomies($access_level, $settings). Omit $access_level to use the current user or visitor.
PHP class: AAM_Framework_Service_Taxonomies.
The methods below require the premium add-on.
Method reference
| Method | Purpose |
|---|---|
is_hidden_on($resource_identifier, $website_area) |
Check whether listing is hidden in an area. |
is_hidden($resource_identifier) |
Check whether listing is hidden. |
is_denied_to($resource_identifier, $permission) |
Check whether an action is denied. |
is_allowed_to($resource_identifier, $permission) |
Check whether an action is allowed. |
deny($resource_identifier, $permission) |
Store a deny rule. |
allow($resource_identifier, $permission) |
Store an allow rule. |
hide($resource_identifier, $website_area = null) |
Deny listing. |
show($resource_identifier, $website_area = null) |
Allow listing. |
aggregate() |
Get effective permissions for this resource type. |
Return values vary by method. Rule updates usually return bool; reads can return a value, null, or an array. Errors follow the service’s error_handling setting and may produce WP_Error.
Accepted identifiers
Pass a registered taxonomy slug string such as 'category' or a WP_Taxonomy object from get_taxonomy('category'). The identifier selects the entire taxonomy; use the terms service for one term.
Example
$taxonomies = AAM::api()->taxonomies('role:subscriber');
$taxonomies->hide('category', 'frontend');
$hidden = $taxonomies->is_hidden_on('category', 'frontend');
These premium calls hide terms in the category taxonomy from frontend listings for Subscribers. $hidden checks that area-specific decision.
Developer notes
- Pass a registered taxonomy slug or
WP_Taxonomy. - Use the terms service for one term.
- The selected access level determines whose rules are stored or evaluated. See Access levels.
Behavior and parameters
- Pass a registered taxonomy slug such as
category.deny()andallow()accept a permission string or array. hide()andshow()affect listing, optionally scoped to a website area.aggregate()reads the taxonomy permission map. There is no publicreset()method on this service.