woocommerce_mcp_include_ability
Filter to override MCP ability inclusion decision.
Usage
add_filter( 'woocommerce_mcp_include_ability', 'wp_kama_woocommerce_mcp_include_ability_filter', 10, 2 );
/**
* Function for `woocommerce_mcp_include_ability` filter-hook.
*
* @param bool $include Whether to include the ability by default. True when the ability has `expose_in_deprecated_woocommerce_mcp => true` in its metadata (set automatically on REST-derived abilities by RestAbilityFactory). Migration note: this value no longer represents whether the ability uses the `woocommerce/` namespace. Return unchanged to keep the default, or return true/false to override.
* @param string $ability_id The ability ID.
*
* @return bool
*/
function wp_kama_woocommerce_mcp_include_ability_filter( $include, $ability_id ){
// filter...
return $include;
}
- $include(true|false)
- Whether to include the ability by default. True when the ability has
expose_in_deprecated_woocommerce_mcp => truein its metadata (set automatically on REST-derived abilities by RestAbilityFactory). Migration note: this value no longer represents whether the ability uses thewoocommerce/namespace. Return unchanged to keep the default, or return true/false to override. - $ability_id(string)
- The ability ID.
Changelog
| Since 10.3.0 | Introduced. |
Where the hook is called
woocommerce_mcp_include_ability
woocommerce/src/Internal/MCP/MCPAdapterProvider.php 187
return apply_filters( 'woocommerce_mcp_include_ability', $include, $ability_id );