heartbeat_settings

The WordPress Core heartbeat settings hook.

Description

add_filter( 'heartbeat_settings', (string) $wp_heartbeat_set_suspension ); 

Parameters (1)

0. $wp_heartbeat_set_suspension (string) => 'wp_heartbeat_set_suspension'
The wp heartbeat set suspension.

Usage

To run the hook, copy the example below.
  1. $wp_heartbeat_set_suspension = apply_filters( 'heartbeat_settings', $wp_heartbeat_set_suspension ); 
  2.  
  3. if ( !empty( $wp_heartbeat_set_suspension ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the heartbeat_settings callback 
  2. function filter_heartbeat_settings( $wp_heartbeat_set_suspension ) { 
  3. // make filter magic happen here... 
  4. return $wp_heartbeat_set_suspension
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'heartbeat_settings', 'filter_heartbeat_settings', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'heartbeat_settings', 'filter_heartbeat_settings', 10, 1 ); 

Defined (3)

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

/wp-admin/includes/admin-filters.php  
  1. add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' ); 
/wp-includes/default-filters.php  
  1. add_filter( 'heartbeat_settings', 'wp_heartbeat_settings' ); 
/wp-includes/script-loader.php  
  1. apply_filters( 'heartbeat_settings', array() )