bp_is_activity_heartbeat_active
Filters whether or not Activity Heartbeat refresh is enabled.
Description
apply_filters( 'bp_is_activity_heartbeat_active', (bool) $bool_bp_get_option_bp_enable_heartbeat_refresh_default );
Parameters (1)
- 0. $bool_bp_get_option_bp_enable_heartbeat_refresh_default (bool) =>
(bool) bp_get_option( '_bp_enable_heartbeat_refresh', $default )
- The bool bp get option bp enable heartbeat refresh default.
Usage
- To run the hook, copy the example below.
- $bool_bp_get_option_bp_enable_heartbeat_refresh_default = apply_filters( 'bp_is_activity_heartbeat_active', $bool_bp_get_option_bp_enable_heartbeat_refresh_default );
- if ( !empty( $bool_bp_get_option_bp_enable_heartbeat_refresh_default ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the bp_is_activity_heartbeat_active callback
- function filter_bp_is_activity_heartbeat_active( $bool_bp_get_option_bp_enable_heartbeat_refresh_default ) {
- // make filter magic happen here...
- return $bool_bp_get_option_bp_enable_heartbeat_refresh_default;
- };
- // add the filter
- add_filter( 'bp_is_activity_heartbeat_active', 'filter_bp_is_activity_heartbeat_active', 10, 1 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'bp_is_activity_heartbeat_active', 'filter_bp_is_activity_heartbeat_active', 10, 1 );
Defined (1)
The filter is defined in the following location(s).
- /bp-core/bp-core-options.php
- return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $default ) );