heartbeat_tick
Fires when Heartbeat ticks in logged-in environments.
Description
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.
- // run the action
- do_action( 'heartbeat_tick', $response, $screen_id );
- The following example is for adding a hook callback.
- // define the heartbeat_tick callback
- function action_heartbeat_tick( $response, $screen_id ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'heartbeat_tick', 'action_heartbeat_tick', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the action
- 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
- do_action( 'heartbeat_tick', $response, $screen_id );