wp_get_abilities_item_include
Filters whether an individual ability should be included in the result set.
Fires after the declarative filters and the caller-scoped item_include_callback. Plugins can use this to enforce universal inclusion rules regardless of what the caller passed in $args.
Usage
add_filter( 'wp_get_abilities_item_include', 'wp_kama_get_abilities_item_include_filter', 10, 3 );
/**
* Function for `wp_get_abilities_item_include` filter-hook.
*
* @param bool $include Whether to include the ability.
* @param WP_Ability $ability The ability instance being evaluated.
* @param array $args The full $args array passed to wp_get_abilities().
*
* @return bool
*/
function wp_kama_get_abilities_item_include_filter( $include, $ability, $args ){
// filter...
return $include;
}
- $include(true|false)
- Whether to include the ability.
Default: true (after declarative filters pass) - $ability(WP_Ability)
- The ability instance being evaluated.
- $args(array)
- The full $args array passed to wp_get_abilities().
Changelog
| Since 7.1.0 | Introduced. |
Where the hook is called
wp_get_abilities_item_include
wp-includes/abilities-api.php 549
$include = (bool) apply_filters( 'wp_get_abilities_item_include', $include, $ability, $args );