wp_get_abilities_result filter-hookWP 7.1.0

Filters the full list of matched abilities after all per-item filtering is complete.

Fires after the caller-scoped result_callback. Plugins can use this to sort, paginate, or reshape the final result set universally.

Usage

add_filter( 'wp_get_abilities_result', 'wp_kama_get_abilities_result_filter', 10, 2 );

/**
 * Function for `wp_get_abilities_result` filter-hook.
 * 
 * @param WP_Ability[] $matched The matched abilities after all filtering.
 * @param array        $args    The full $args array passed to wp_get_abilities().
 *
 * @return WP_Ability[]
 */
function wp_kama_get_abilities_result_filter( $matched, $args ){
	// filter...
	return $matched;
}
$matched(WP_Ability[])
The matched abilities after all filtering.
$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()
wp_get_abilities_result
wp-includes/abilities-api.php 572
return (array) apply_filters( 'wp_get_abilities_result', $matched, $args );

Where the hook is used in WordPress

Usage not found.