wppaste
WordPress

apply_filters( 'wp_get_abilities_item_include', bool $include, WP_Ability $ability, array $args )

Since
7.1.0
Filters whether an individual ability should be included in the result set.

Description

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.

Compatibility

WordPress
since 7.1.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in 1 of the 5 tracked releases, added in 7.1.0.

Parameters

$includebool
Whether to include the ability. Default true (after declarative filters pass).
$abilityWP_Ability
The ability instance being evaluated.
$argsarray
The full $args array passed to wp_get_abilities().

Where this hook fires · 1

  • wp-includes/abilities-api.php:549wp_get_abilities()

Source code

		 * @since 7.1.0		 *		 * @param bool       $include Whether to include the ability. Default true (after declarative filters pass).		 * @param WP_Ability $ability The ability instance being evaluated.		 * @param array      $args    The full $args array passed to wp_get_abilities().		 */		$include = (bool) apply_filters( 'wp_get_abilities_item_include', $include, $ability, $args ); 		if ( $include ) {			$matched[ $name ] = $ability;		}	}

Changelog

Introduced in 7.1.0.

Signature, return type and hooks compared across 1 parsed release.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.