wp_ability_normalize_input filter-hookWP 7.1.0

Filters the normalized input for an ability.

Fires after normalize_input() has applied any default value declared in the input schema, giving plugins a chance to adjust the input before it is consumed downstream. Common uses include defaulting beyond what JSON Schema can express, prompt enrichment, and injecting caller metadata.

Returning a WP_Error causes callers that propagate it (such as execute()) to halt before validation, permission checks, and the registered execute callback.

Usage

add_filter( 'wp_ability_normalize_input', 'wp_kama_ability_normalize_input_filter', 10, 3 );

/**
 * Function for `wp_ability_normalize_input` filter-hook.
 * 
 * @param mixed      $input        The normalized input data.
 * @param string     $ability_name The name of the ability.
 * @param WP_Ability $ability      The ability instance.
 *
 * @return mixed
 */
function wp_kama_ability_normalize_input_filter( $input, $ability_name, $ability ){

	// filter...
	return $input;
}
$input(mixed)
The normalized input data.
$ability_name(string)
The name of the ability.
$ability(WP_Ability)
The ability instance.

Changelog

Since 7.1.0 Introduced.

Where the hook is called

WP_Ability::normalize_input()
wp_ability_normalize_input
wp-includes/abilities-api/class-wp-ability.php 508
return apply_filters( 'wp_ability_normalize_input', $input, $this->name, $this );

Where the hook is used in WordPress

Usage not found.