bp_nouveau_is_feed_enable()

Checks whether the Activity RSS links should be output.


Return Return

(bool) True to output the Activity RSS link. False otherwise.


Source Source

File: bp-templates/bp-nouveau/includes/template-tags.php

function bp_nouveau_is_feed_enable() {
	$retval     = false;
	$bp_nouveau = bp_nouveau();

	if ( bp_is_active( 'activity' ) && 'activity' === bp_current_component() ) {
		if ( isset( $bp_nouveau->activity->current_rss_feed ) ) {
			$bp_nouveau->activity->current_rss_feed = array(
				'link'               => '',
				'tooltip'            => _x( 'RSS Feed', 'BP RSS Tooltip', 'buddypress' ),
				'screen_reader_text' => _x( 'RSS', 'BP RSS screen reader text', 'buddypress' ),
			);

			if ( ! bp_is_user() && ! bp_is_group() ) {
				$retval = bp_activity_is_feed_enable( 'sitewide' );

				if ( $retval ) {
					$bp_nouveau->activity->current_rss_feed['link'] = bp_get_sitewide_activity_feed_link();
				}
			} elseif ( bp_is_user_activity() ) {
				$retval = bp_activity_is_feed_enable( 'personal' );

				if ( $retval ) {
					$bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/feed' );
				}

				if ( bp_is_active( 'friends' ) && bp_is_current_action( bp_nouveau_get_component_slug( 'friends' ) ) ) {
					$retval = bp_activity_is_feed_enable( 'friends' );

					if ( $retval ) {
						$bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/' . bp_nouveau_get_component_slug( 'friends' ) . '/feed' );
					}
				} elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_nouveau_get_component_slug( 'groups' ) ) ) {
					$retval = bp_activity_is_feed_enable( 'mygroups' );

					if ( $retval ) {
						$bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/' . bp_nouveau_get_component_slug( 'groups' ) . '/feed' );
					}
				} elseif ( bp_activity_do_mentions() && bp_is_current_action( 'mentions' ) ) {
					$retval = bp_activity_is_feed_enable( 'mentions' );

					if ( $retval ) {
						$bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/mentions/feed' );
					}
				} elseif ( bp_activity_can_favorite() && bp_is_current_action( 'favorites' ) ) {
					$retval = bp_activity_is_feed_enable( 'mentions' );

					if ( $retval ) {
						$bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_nouveau_get_component_slug( 'activity' ) . '/favorites/feed' );
					}
				}
			}
		}
	}

	return $retval;
}


Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.