Filter hook 'heartbeat_send'

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

View Source

heartbeat_send

Filter Hook
Description
Filters the Heartbeat response sent.

Hook Information

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

Hook Parameters

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

Usage Examples

Basic Usage
<?php
// Hook into heartbeat_send
add_filter('heartbeat_send', 'my_custom_filter', 10, 2);

function my_custom_filter($response, $screen_id) {
    // Your custom filtering logic here
    return $response;
}

Source Code Context

wp-admin/includes/ajax-actions.php:3514 - How this hook is used in WordPress core
<?php
3509  	 * @since 3.6.0
3510  	 *
3511  	 * @param array  $response  The Heartbeat response.
3512  	 * @param string $screen_id The screen ID.
3513  	 */
3514  	$response = apply_filters( 'heartbeat_send', $response, $screen_id );
3515  
3516  	/**
3517  	 * Fires when Heartbeat ticks in logged-in environments.
3518  	 *
3519  	 * Allows the transport to be easily replaced with long-polling.

PHP Documentation

<?php
/**
	 * Filters the Heartbeat response sent.
	 *
	 * @since 3.6.0
	 *
	 * @param array  $response  The Heartbeat response.
	 * @param string $screen_id The screen ID.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/ajax-actions.php
Related Hooks

Related hooks will be displayed here in future updates.