heartbeat_nopriv_received

Filters Heartbeat Ajax response in no-privilege environments.

Description

apply_filters( 'heartbeat_nopriv_received', (array|object) $response, (array) $data, (string) $screen_id ); 

Parameters (3)

0. $response (array|object)
The no-priv Heartbeat response object or array.
1. $data (array)
An array of data passed via $_POST.
2. $screen_id (string)
The screen id.

Usage

To run the hook, copy the example below.
  1. $response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id ); 
  2.  
  3. if ( !empty( $response ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the heartbeat_nopriv_received callback 
  2. function filter_heartbeat_nopriv_received( $response, $data, $screen_id ) { 
  3. // make filter magic happen here... 
  4. return $response
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'heartbeat_nopriv_received', 'filter_heartbeat_nopriv_received', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'heartbeat_nopriv_received', 'filter_heartbeat_nopriv_received', 10, 3 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-admin/includes/ajax-actions.php  
  1. $response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );