heartbeat_tick

Fires when Heartbeat ticks in logged-in environments.

Description

do_action( 'heartbeat_tick', (array) $response, (string) $screen_id ); 

Allows the transport to be easily replaced with long-polling.

Parameters (2)

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

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'heartbeat_tick', $response, $screen_id ); 
The following example is for adding a hook callback.
  1. // define the heartbeat_tick callback 
  2. function action_heartbeat_tick( $response, $screen_id ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'heartbeat_tick', 'action_heartbeat_tick', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'heartbeat_tick', 'action_heartbeat_tick', 10, 2 ); 

Defined (1)

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

/wp-admin/includes/ajax-actions.php  
  1. do_action( 'heartbeat_tick', $response, $screen_id );