Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/27/2021 04:56:32 AM (9 months ago)
Author:
imath
Message:

Improve ways to disable BP RSS feeds

Returning false to the filter bp_activity_enable_feeds is completely disabling all RSS feeds and will now avoid the output of an empty link.

A second argument has been added to the filter to allow to disable a specific feed in particular, one of these feed identifiers:

  • 'sitewide',
  • 'personal',
  • 'friends',
  • 'mygroups',
  • 'mentions',
  • 'favorites'.

The BP Nouveau Template pack has also been improved to update the user's profile activity RSS feed links according to the context.

Props sippis

Fixes #8454

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-functions.php

    r12694 r12907  
    42664266    );
    42674267}
     4268
     4269/**
     4270 * Checks whether an activity feed is enabled.
     4271 *
     4272 * @since 8.0.0
     4273 *
     4274 * @param string $feed_id The feed identifier. Possible values are:
     4275 *                        'sitewide', 'personal', 'friends', 'mygroups', 'mentions', 'favorites'.
     4276 */
     4277function bp_activity_is_feed_enable( $feed_id = '' ) {
     4278    /**
     4279     * Filters if BuddyPress should consider feeds enabled. If disabled, it will return early.
     4280     *
     4281     * @since 1.8.0
     4282     * @since 8.0.0 Adds the `$feed_id` parameter.
     4283     *
     4284     * @param bool   $value   Defaults to true aka feeds are enabled.
     4285     * @param string $feed_id The feed identifier.
     4286     */
     4287    return (bool) apply_filters( 'bp_activity_enable_feeds', true, $feed_id );
     4288}
Note: See TracChangeset for help on using the changeset viewer.