Action hook 'heartbeat_nopriv_tick'

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

View Source

heartbeat_nopriv_tick

Action Hook
Description
Fires when Heartbeat ticks in no-privilege environments. Allows the transport to be easily replaced with long-polling.

Hook Information

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

Hook Parameters

Type Name Description
array $response The no-priv Heartbeat response.
string $screen_id The screen ID.

Usage Examples

Basic Usage
<?php
// Hook into heartbeat_nopriv_tick
add_action('heartbeat_nopriv_tick', 'my_custom_function', 10, 2);

function my_custom_function($response, $screen_id) {
    // Your custom code here
}

Source Code Context

wp-admin/includes/ajax-actions.php:66 - How this hook is used in WordPress core
<?php
  61  	 * @since 3.6.0
  62  	 *
  63  	 * @param array  $response  The no-priv Heartbeat response.
  64  	 * @param string $screen_id The screen ID.
  65  	 */
  66  	do_action( 'heartbeat_nopriv_tick', $response, $screen_id );
  67  
  68  	// Send the current time according to the server.
  69  	$response['server_time'] = time();
  70  
  71  	wp_send_json( $response );

PHP Documentation

<?php
/**
	 * Fires when Heartbeat ticks in no-privilege environments.
	 *
	 * Allows the transport to be easily replaced with long-polling.
	 *
	 * @since 3.6.0
	 *
	 * @param array  $response  The no-priv Heartbeat response.
	 * @param string $screen_id The screen ID.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 2
  • File: wp-admin/includes/ajax-actions.php
Related Hooks

Related hooks will be displayed here in future updates.