Filter hook 'wp_refresh_nonces'

in WP Core File wp-admin/includes/ajax-actions.php at line 3484

View Source

wp_refresh_nonces

Filter Hook
Description
Filters the nonces to send to the New/Edit Post screen.

Hook Information

File Location wp-admin/includes/ajax-actions.php View on GitHub
Hook Type Filter
Line Number 3484

Hook Parameters

Type Name Description
array $response The Heartbeat response.
array $data The $_POST data sent.
string $screen_id The screen ID.

Usage Examples

Basic Usage
<?php
// Hook into wp_refresh_nonces
add_filter('wp_refresh_nonces', 'my_custom_filter', 10, 3);

function my_custom_filter($response, $data, $screen_id) {
    // Your custom filtering logic here
    return $response;
}

Source Code Context

wp-admin/includes/ajax-actions.php:3484 - How this hook is used in WordPress core
<?php
3479  		 *
3480  		 * @param array  $response  The Heartbeat response.
3481  		 * @param array  $data      The $_POST data sent.
3482  		 * @param string $screen_id The screen ID.
3483  		 */
3484  		$response = apply_filters( 'wp_refresh_nonces', $response, $data, $screen_id );
3485  
3486  		if ( false === $nonce_state ) {
3487  			// User is logged in but nonces have expired.
3488  			$response['nonces_expired'] = true;
3489  			wp_send_json( $response );

PHP Documentation

<?php
/**
		 * Filters the nonces to send to the New/Edit Post screen.
		 *
		 * @since 4.3.0
		 *
		 * @param array  $response  The Heartbeat response.
		 * @param array  $data      The $_POST data sent.
		 * @param string $screen_id The screen ID.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-admin/includes/ajax-actions.php
Related Hooks

Related hooks will be displayed here in future updates.