Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/21/2014 02:49:33 PM (12 years ago)
Author:
boonebgorges
Message:

Automatically check for newly created items when viewing the Activity Stream.

Leveraging WP's Heartbeat API, this new functionality performs periodic checks
to see whether new activity items matching the current filter have been posted
since the page was originally loaded. If new items are found, a Load Newest
link is inserted into the top of the stream, which will insert the new items.

A filter is included, bp_activity_heartbeat_pulse, that allows site owners to
set a specific interval for these checks. The default value is 15 seconds, or
whatever your global Heartbeat interval is.

To disable the feature, there is a new setting "Automatically check for new
activity items when viewing the activity stream".

Fixes #5328

Props imath, boonebgorges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-options.php

    r7904 r7952  
    7676        // Users from all sites can post
    7777        '_bp_enable_akismet'              => true,
     78
     79        /** Activity HeartBeat ************************************************/
     80
     81        // HeartBeat is on to refresh activities
     82        '_bp_enable_heartbeat_refresh'    => true,
    7883
    7984        /** BuddyBar **********************************************************/
     
    587592
    588593/**
     594 * Check whether Activity Heartbeat refresh is enabled.
     595 *
     596 * @since BuddyPress (2.0.0)
     597 *
     598 * @uses bp_get_option() To get the Heartbeat option.
     599 *
     600 * @param bool $default Optional. Fallback value if not found in the database.
     601 *        Default: true.
     602 * @return bool True if Heartbeat refresh is enabled, otherwise false.
     603 */
     604function bp_is_activity_heartbeat_active( $default = true ) {
     605    return (bool) apply_filters( 'bp_is_activity_heartbeat_active', (bool) bp_get_option( '_bp_enable_heartbeat_refresh', $default ) );
     606}
     607
     608/**
    589609 * Get the current theme package ID.
    590610 *
Note: See TracChangeset for help on using the changeset viewer.