Skip to main content

Filter: gk/block-mcp/term/allow-taxonomy

Decide which taxonomies the AI can browse terms from.

By default the assistant can only list terms from taxonomies you've already exposed to the REST API — the same line WordPress draws for its own endpoints, so private bookkeeping taxonomies stay private. Use this filter to open a single deliberately-internal taxonomy (a workflow status, an editorial desk) just for the agent, so it can assign those terms — without flipping show_in_rest and exposing it everywhere. You can also return false to hide a normally-listable taxonomy.

Parameters

NameTypeDescription
$allowboolWhether the taxonomy is listable (defaults to its show_in_rest value).
$taxonomystringSanitized taxonomy slug.
$tax_object\WP_Taxonomy|null|falseTaxonomy object, or null/false if not registered.

Example

// Let the assistant assign terms from a private "editorial_status" taxonomy.

add_filter( 'gk/block-mcp/term/allow-taxonomy', function ( $allow, $taxonomy ) {
return 'editorial_status' === $taxonomy ? true : $allow;
}, 10, 2 );

Since

Source

Defined in wordpress-plugin/gk-block-api/includes/class-term-manager.php at line 81