bb_feed_head
The BuddyPress bb feed head function.
Description
bb_feed_head();
Usage
if ( !function_exists( 'bb_feed_head' ) ) { require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; } // NOTICE! Understand what this does before running. $result = bb_feed_head();
Defined (1)
The function is defined in the following location(s).
- /bp-forums/bbpress/bb-includes/functions.bb-template.php
- function bb_feed_head() {
- $feeds = array();
- switch (bb_get_location()) {
- case 'profile-page':
- if ( $tab = isset($_GET['tab']) ? $_GET['tab'] : bb_get_path(2) )
- if ($tab != 'favorites')
- break;
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » User Favorites: %2$s'), bb_get_option( 'name' ), get_user_name()),
- );
- break;
- case 'topic-page':
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » Topic: %2$s'), bb_get_option( 'name' ), get_topic_title()),
- );
- break;
- case 'tag-page':
- if (bb_is_tag()) {
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » Tag: %2$s - Recent Posts'), bb_get_option( 'name' ), bb_get_tag_name()),
- );
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » Tag: %2$s - Recent Topics'), bb_get_option( 'name' ), bb_get_tag_name()),
- );
- }
- break;
- case 'forum-page':
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » Forum: %2$s - Recent Posts'), bb_get_option( 'name' ), get_forum_name()),
- );
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » Forum: %2$s - Recent Topics'), bb_get_option( 'name' ), get_forum_name()),
- );
- break;
- case 'front-page':
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » Recent Posts'), bb_get_option( 'name' )),
- );
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » Recent Topics'), bb_get_option( 'name' )),
- );
- break;
- case 'view-page':
- global $bb_views, $view;
- if ($bb_views[$view]['feed']) {
- $feeds[] = array(
- 'title' => sprintf(__('%1$s » View: %2$s'), bb_get_option( 'name' ), get_view_name()),
- );
- }
- break;
- }
- if (count($feeds)) {
- $feed_links = array();
- foreach ($feeds as $feed) {
- $link = '<link rel="alternate" type="application/rss+xml" ';
- $link .= 'title="' . esc_attr($feed['title']) . '" ';
- $link .= 'href="' . esc_attr($feed['href']) . '" />';
- $feed_links[] = $link;
- }
- $feed_links = join("\n", $feed_links);
- } else {
- $feed_links = '';
- }
- echo apply_filters('bb_feed_head', $feed_links);
- }