bb_feed_head

The BuddyPress bb feed head function.

Description

bb_feed_head(); 

Usage

  1. if ( !function_exists( 'bb_feed_head' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bb_feed_head(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_feed_head() { 
  2.  
  3. $feeds = array(); 
  4.  
  5. switch (bb_get_location()) { 
  6. case 'profile-page': 
  7. if ( $tab = isset($_GET['tab']) ? $_GET['tab'] : bb_get_path(2) ) 
  8. if ($tab != 'favorites') 
  9. break; 
  10.  
  11. $feeds[] = array( 
  12. 'title' => sprintf(__('%1$s » User Favorites: %2$s'), bb_get_option( 'name' ), get_user_name()),  
  13. ); 
  14. break; 
  15.  
  16. case 'topic-page': 
  17. $feeds[] = array( 
  18. 'title' => sprintf(__('%1$s » Topic: %2$s'), bb_get_option( 'name' ), get_topic_title()),  
  19. ); 
  20. break; 
  21.  
  22. case 'tag-page': 
  23. if (bb_is_tag()) { 
  24. $feeds[] = array( 
  25. 'title' => sprintf(__('%1$s » Tag: %2$s - Recent Posts'), bb_get_option( 'name' ), bb_get_tag_name()),  
  26. ); 
  27. $feeds[] = array( 
  28. 'title' => sprintf(__('%1$s » Tag: %2$s - Recent Topics'), bb_get_option( 'name' ), bb_get_tag_name()),  
  29. ); 
  30. break; 
  31.  
  32. case 'forum-page': 
  33. $feeds[] = array( 
  34. 'title' => sprintf(__('%1$s » Forum: %2$s - Recent Posts'), bb_get_option( 'name' ), get_forum_name()),  
  35. ); 
  36. $feeds[] = array( 
  37. 'title' => sprintf(__('%1$s » Forum: %2$s - Recent Topics'), bb_get_option( 'name' ), get_forum_name()),  
  38. ); 
  39. break; 
  40.  
  41. case 'front-page': 
  42. $feeds[] = array( 
  43. 'title' => sprintf(__('%1$s » Recent Posts'), bb_get_option( 'name' )),  
  44. ); 
  45. $feeds[] = array( 
  46. 'title' => sprintf(__('%1$s » Recent Topics'), bb_get_option( 'name' )),  
  47. ); 
  48. break; 
  49.  
  50. case 'view-page': 
  51. global $bb_views, $view; 
  52. if ($bb_views[$view]['feed']) { 
  53. $feeds[] = array( 
  54. 'title' => sprintf(__('%1$s » View: %2$s'), bb_get_option( 'name' ), get_view_name()),  
  55. ); 
  56. break; 
  57.  
  58. if (count($feeds)) { 
  59. $feed_links = array(); 
  60. foreach ($feeds as $feed) { 
  61. $link = '<link rel="alternate" type="application/rss+xml" '; 
  62. $link .= 'title="' . esc_attr($feed['title']) . '" '; 
  63. $link .= 'href="' . esc_attr($feed['href']) . '" />'; 
  64. $feed_links[] = $link; 
  65. $feed_links = join("\n", $feed_links); 
  66. } else { 
  67. $feed_links = ''; 
  68.  
  69. echo apply_filters('bb_feed_head', $feed_links);