wp_protected_ajax_actions filter-hookWP 5.2.0

Filters the array of protected Ajax actions.

This filter is only fired when doing Ajax and the Ajax request has an 'action' property.

Usage

add_filter( 'wp_protected_ajax_actions', 'wp_kama_protected_ajax_actions_filter' );

/**
 * Function for `wp_protected_ajax_actions` filter-hook.
 * 
 * @param string[] $actions_to_protect Array of strings with Ajax actions to protect.
 *
 * @return string[]
 */
function wp_kama_protected_ajax_actions_filter( $actions_to_protect ){

	// filter...
	return $actions_to_protect;
}
$actions_to_protect(string[])
Array of strings with Ajax actions to protect.

Changelog

Since 5.2.0 Introduced.

Where the hook is called

is_protected_ajax_action()
wp_protected_ajax_actions
wp-includes/load.php 1042
$actions_to_protect = (array) apply_filters( 'wp_protected_ajax_actions', $actions_to_protect );

Where the hook is used in WordPress

Usage not found.