heartbeat_nopriv_send

Filters Heartbeat Ajax response when no data is passed.

Description

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

Parameters (2)

0. $response (array|object)
The Heartbeat response object or array.
1. $screen_id (string)
The screen id.

Usage

To run the hook, copy the example below.
  1. $response = apply_filters( 'heartbeat_nopriv_send', $response, $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_send callback 
  2. function filter_heartbeat_nopriv_send( $response, $screen_id ) { 
  3. // make filter magic happen here... 
  4. return $response
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'heartbeat_nopriv_send', 'filter_heartbeat_nopriv_send', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'heartbeat_nopriv_send', 'filter_heartbeat_nopriv_send', 10, 2 ); 

Defined (2)

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

/wp-admin/includes/ajax-actions.php  
  1. $response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id ); 
/wp-includes/default-filters.php  
  1. add_filter( 'heartbeat_nopriv_send', 'wp_auth_check' );