Changeset 12907
- Timestamp:
- 04/27/2021 04:56:32 AM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/actions/feeds.php
r12586 r12907 18 18 $bp = buddypress(); 19 19 20 if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) ) 21 return false; 20 if ( ! bp_is_activity_component() || ! bp_is_current_action( 'feed' ) || bp_is_user() || ! empty( $bp->groups->current_group ) ) { 21 return false; 22 } 23 24 $link = bp_get_activity_directory_permalink(); 22 25 23 26 // Setup the feed. … … 27 30 /* translators: %s Site Name */ 28 31 'title' => sprintf( __( '%s | Site-Wide Activity', 'buddypress' ), bp_get_site_name() ), 29 'link' => bp_get_activity_directory_permalink(),32 'link' => $link, 30 33 'description' => __( 'Activity feed for the entire site.', 'buddypress' ), 31 34 'activity_args' => 'display_comments=threaded' 32 35 ) ); 36 37 if ( ! buddypress()->activity->feed->enabled ) { 38 bp_core_redirect( $link ); 39 } 33 40 } 34 41 add_action( 'bp_actions', 'bp_activity_action_sitewide_feed' ); … … 46 53 } 47 54 55 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ); 56 48 57 // Setup the feed. 49 58 buddypress()->activity->feed = new BP_Activity_Feed( array( … … 52 61 /* translators: 1: Site Name. 2: User Display Name. */ 53 62 'title' => sprintf( _x( '%1$s | %2$s | Activity', 'Personal activity feed title', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 54 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() ),63 'link' => $link, 55 64 56 65 /* translators: %s: User Display Name */ … … 58 67 'activity_args' => 'user_id=' . bp_displayed_user_id() 59 68 ) ); 69 70 if ( ! buddypress()->activity->feed->enabled ) { 71 bp_core_redirect( $link ); 72 } 60 73 } 61 74 add_action( 'bp_actions', 'bp_activity_action_personal_feed' ); … … 73 86 } 74 87 88 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ); 89 75 90 // Setup the feed. 76 91 buddypress()->activity->feed = new BP_Activity_Feed( array( … … 79 94 /* translators: 1: Site Name 2: User Display Name */ 80 95 'title' => sprintf( __( '%1$s | %2$s | Friends Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 81 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() ),96 'link' => $link, 82 97 83 98 /* translators: %s: User Display Name */ … … 85 100 'activity_args' => 'scope=friends' 86 101 ) ); 102 103 if ( ! buddypress()->activity->feed->enabled ) { 104 bp_core_redirect( $link ); 105 } 87 106 } 88 107 add_action( 'bp_actions', 'bp_activity_action_friends_feed' ); … … 103 122 $groups = groups_get_user_groups(); 104 123 $group_ids = implode( ',', $groups['groups'] ); 124 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ); 105 125 106 126 // Setup the feed. … … 110 130 /* translators: 1: Site Name 2: User Display Name */ 111 131 'title' => sprintf( __( '%1$s | %2$s | Group Activity', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 112 'link' => trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() ),132 'link' => $link, 113 133 114 134 /* translators: %s: User Display Name */ … … 120 140 ) 121 141 ) ); 142 143 if ( ! buddypress()->activity->feed->enabled ) { 144 bp_core_redirect( $link ); 145 } 122 146 } 123 147 add_action( 'bp_actions', 'bp_activity_action_my_groups_feed' ); … … 135 159 } 136 160 137 if ( !bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) { 138 return false; 139 } 161 if ( ! bp_is_user_activity() || ! bp_is_current_action( 'mentions' ) || ! bp_is_action_variable( 'feed', 0 ) ) { 162 return false; 163 } 164 165 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions' ); 140 166 141 167 // Setup the feed. … … 145 171 /* translators: 1: Site Name 2: User Display Name */ 146 172 'title' => sprintf( __( '%1$s | %2$s | Mentions', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 147 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/',173 'link' => $link, 148 174 149 175 /* translators: %s: User Display Name */ … … 153 179 ) 154 180 ) ); 181 182 if ( ! buddypress()->activity->feed->enabled ) { 183 bp_core_redirect( $link ); 184 } 155 185 } 156 186 add_action( 'bp_actions', 'bp_activity_action_mentions_feed' ); … … 169 199 170 200 // Get displayed user's favorite activity IDs. 171 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() );201 $favs = bp_activity_get_user_favorites( bp_displayed_user_id() ); 172 202 $fav_ids = implode( ',', (array) $favs ); 203 $link = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites' ); 173 204 174 205 // Setup the feed. … … 178 209 /* translators: 1: Site Name 2: User Display Name */ 179 210 'title' => sprintf( __( '%1$s | %2$s | Favorites', 'buddypress' ), bp_get_site_name(), bp_get_displayed_user_fullname() ), 180 'link' => bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/',211 'link' => $link, 181 212 182 213 /* translators: %s: User Display Name */ … … 184 215 'activity_args' => 'include=' . $fav_ids 185 216 ) ); 217 218 if ( ! buddypress()->activity->feed->enabled ) { 219 bp_core_redirect( $link ); 220 } 186 221 } 187 222 add_action( 'bp_actions', 'bp_activity_action_favorites_feed' ); -
trunk/src/bp-activity/bp-activity-functions.php
r12694 r12907 4266 4266 ); 4267 4267 } 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 */ 4277 function 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 } -
trunk/src/bp-activity/classes/class-bp-activity-feed.php
r10487 r12907 88 88 */ 89 89 public function __construct( $args = array() ) { 90 91 /** 92 * Filters if BuddyPress should consider feeds enabled. If disabled, it will return early. 93 * 94 * @since 1.8.0 95 * 96 * @param bool true Default true aka feeds are enabled. 97 */ 98 if ( false === (bool) apply_filters( 'bp_activity_enable_feeds', true ) ) { 90 $feed_id = ''; 91 92 if ( isset( $args['id'] ) ) { 93 $feed_id = sanitize_key( $args['id'] ); 94 } 95 96 if ( false === bp_activity_is_feed_enable( $feed_id ) ) { 99 97 global $wp_query; 100 98 … … 102 100 $wp_query->is_feed = false; 103 101 104 return false; 105 } 106 107 // Setup data. 108 $this->data = wp_parse_args( $args, array( 109 // Internal identifier for the RSS feed - should be alphanumeric only. 110 'id' => '', 111 112 // RSS title - should be plain-text. 113 'title' => '', 114 115 // Relevant link for the RSS feed. 116 'link' => '', 117 118 // RSS description - should be plain-text. 119 'description' => '', 120 121 // Time-to-live - number of minutes to cache the data before an aggregator 122 // requests it again. This is only acknowledged if the RSS client supports it 123 // 124 // See: http://www.rssboard.org/rss-profile#element-channel-ttl. 125 // See: http://www.kbcafe.com/rss/rssfeedstate.html#ttl. 126 'ttl' => '30', 127 128 // Syndication module - similar to ttl, but not really supported by RSS 129 // clients 130 // 131 // See: http://web.resource.org/rss/1.0/modules/syndication/#description. 132 // See: http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule. 133 'update_period' => 'hourly', 134 'update_frequency' => 2, 135 136 // Number of items to display. 137 'max' => 50, 138 139 // Activity arguments passed to bp_has_activities(). 140 'activity_args' => array() 141 ) ); 142 143 /** 144 * Fires before the feed is setup so plugins can modify. 145 * 146 * @since 1.8.0 147 * 148 * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference. 149 */ 150 do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) ); 151 152 // Setup class properties. 153 $this->setup_properties(); 154 155 // Check if id is valid. 156 if ( empty( $this->id ) ) { 157 _doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' ); 158 return false; 159 } 160 161 /** 162 * Fires after the feed is setup so plugins can modify. 163 * 164 * @since 1.8.0 165 * 166 * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference. 167 */ 168 do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) ); 169 170 // Setup feed hooks. 171 $this->setup_hooks(); 172 173 // Output the feed. 174 $this->output(); 175 176 // Kill the rest of the output. 177 die(); 102 $this->data = array( 103 'enabled' => false, 104 ); 105 } else { 106 // Setup data. 107 $this->data = wp_parse_args( $args, array( 108 // Internal identifier for the RSS feed - should be alphanumeric only. 109 'id' => '', 110 111 // RSS title - should be plain-text. 112 'title' => '', 113 114 // Relevant link for the RSS feed. 115 'link' => '', 116 117 // RSS description - should be plain-text. 118 'description' => '', 119 120 // Time-to-live - number of minutes to cache the data before an aggregator 121 // requests it again. This is only acknowledged if the RSS client supports it 122 // 123 // See: http://www.rssboard.org/rss-profile#element-channel-ttl. 124 // See: http://www.kbcafe.com/rss/rssfeedstate.html#ttl. 125 'ttl' => '30', 126 127 // Syndication module - similar to ttl, but not really supported by RSS 128 // clients 129 // 130 // See: http://web.resource.org/rss/1.0/modules/syndication/#description. 131 // See: http://www.kbcafe.com/rss/rssfeedstate.html#syndicationmodule. 132 'update_period' => 'hourly', 133 'update_frequency' => 2, 134 135 // Number of items to display. 136 'max' => 50, 137 138 // Activity arguments passed to bp_has_activities(). 139 'activity_args' => array(), 140 141 // The activity feed is enabled. 142 'enabled' => false, 143 ) ); 144 145 /** 146 * Fires before the feed is setup so plugins can modify. 147 * 148 * @since 1.8.0 149 * 150 * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference. 151 */ 152 do_action_ref_array( 'bp_activity_feed_prefetch', array( &$this ) ); 153 154 // Setup class properties. 155 $this->setup_properties(); 156 157 // Check if id is valid. 158 if ( empty( $this->id ) ) { 159 _doing_it_wrong( 'BP_Activity_Feed', __( "RSS feed 'id' must be defined", 'buddypress' ), 'BP 1.8' ); 160 return false; 161 } 162 163 /** 164 * Fires after the feed is setup so plugins can modify. 165 * 166 * @since 1.8.0 167 * 168 * @param BP_Activity_Feed $this Current instance of activity feed. Passed by reference. 169 */ 170 do_action_ref_array( 'bp_activity_feed_postfetch', array( &$this ) ); 171 172 // Setup feed hooks. 173 $this->setup_hooks(); 174 175 // Output the feed. 176 $this->output(); 177 178 // Kill the rest of the output. 179 die(); 180 } 178 181 } 179 182 -
trunk/src/bp-templates/bp-legacy/buddypress/activity/index.php
r12595 r12907 190 190 <div class="item-list-tabs no-ajax" id="subnav" aria-label="<?php esc_attr_e( 'Activity secondary navigation', 'buddypress' ); ?>" role="navigation"> 191 191 <ul> 192 <li class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>" aria-label="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li> 192 <?php if ( bp_activity_is_feed_enable( 'sitewide' ) ) : ?> 193 <li class="feed"> 194 <a href="<?php bp_sitewide_activity_feed_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>" aria-label="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"> 195 <?php esc_html_e( 'RSS', 'buddypress' ); ?> 196 </a> 197 </li> 198 <?php endif; ?> 193 199 194 200 <?php -
trunk/src/bp-templates/bp-legacy/buddypress/groups/single/activity.php
r12082 r12907 11 11 <div class="item-list-tabs no-ajax" id="subnav" aria-label="<?php esc_attr_e( 'Group secondary navigation', 'buddypress' ); ?>" role="navigation"> 12 12 <ul> 13 <li class="feed"><a href="<?php bp_group_activity_feed_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>" aria-label="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"><?php _e( 'RSS', 'buddypress' ); ?></a></li> 13 <?php if ( bp_activity_is_feed_enable( 'group' ) ) : ?> 14 <li class="feed"> 15 <a href="<?php bp_group_activity_feed_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>" aria-label="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"> 16 <?php _e( 'RSS', 'buddypress' ); ?> 17 </a> 18 </li> 19 <?php endif; ?> 14 20 15 21 <?php -
trunk/src/bp-templates/bp-nouveau/buddypress/common/search-and-filters-bar.php
r12892 r12907 12 12 <div class="subnav-search clearfix"> 13 13 14 <?php if ( bp_get_activity_slug() === bp_current_component() ) : ?> 15 <div class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"><span class="bp-screen-reader-text"><?php esc_html_e( 'RSS', 'buddypress' ); ?></span></a></div> 14 <?php if ( bp_nouveau_is_feed_enable() ) : ?> 15 <div id="activity-rss-feed" class="feed"> 16 <a href="<?php bp_nouveau_activity_rss_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php bp_nouveau_activity_rss_tooltip(); ?>"> 17 <span class="bp-screen-reader-text"><?php bp_nouveau_activity_rss_screen_reader_text(); ?></span> 18 </a> 19 </div> 16 20 <?php endif; ?> 17 21 18 22 <?php bp_nouveau_search_form(); ?> 19 23 20 </div>24 </div> 21 25 <?php endif; ?> 22 26 23 24 25 26 27 28 29 27 <?php if ( bp_is_user() && ! bp_is_current_action( 'requests' ) ) : ?> 28 <?php bp_get_template_part( 'common/filters/user-screens-filters' ); ?> 29 <?php elseif ( bp_get_groups_slug() === bp_current_component() ) : ?> 30 <?php bp_get_template_part( 'common/filters/groups-screens-filters' ); ?> 31 <?php else : ?> 32 <?php bp_get_template_part( 'common/filters/directory-filters' ); ?> 33 <?php endif; ?> 30 34 31 35 </div><!-- search & filters --> -
trunk/src/bp-templates/bp-nouveau/buddypress/groups/single/activity.php
r12156 r12907 4 4 * 5 5 * @since 3.0.0 6 * @version 3.1.06 * @version 8.0.0 7 7 */ 8 9 8 ?> 10 9 … … 18 17 19 18 <ul> 20 21 <li class="feed"><a href="<?php bp_group_activity_feed_link(); ?>" class="bp-tooltip no-ajax" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"><span class="bp-screen-reader-text"><?php esc_html_e( 'RSS', 'buddypress' ); ?></span></a></li> 19 <?php if ( bp_activity_is_feed_enable( 'group' ) ) : ?> 20 <li class="feed"> 21 <a href="<?php bp_group_activity_feed_link(); ?>" class="bp-tooltip no-ajax" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"> 22 <span class="bp-screen-reader-text"><?php esc_html_e( 'RSS', 'buddypress' ); ?></span> 23 </a> 24 </li> 25 <?php endif; ?> 22 26 23 27 <li class="group-act-search"><?php bp_nouveau_search_form(); ?></li> 24 25 28 </ul> 26 29 27 30 <?php bp_get_template_part( 'common/filters/groups-screens-filters' ); ?> 28 31 </div><!-- // .subnav-filters --> 29 32 … … 32 35 <div id="activity-stream" class="activity single-group" data-bp-list="activity"> 33 36 34 <li id="bp-activity-ajax-loader"><?php bp_nouveau_user_feedback( 'group-activity-loading' ); ?></li>37 <div id="bp-activity-ajax-loader"><?php bp_nouveau_user_feedback( 'group-activity-loading' ); ?></div> 35 38 36 39 </div><!-- .activity --> -
trunk/src/bp-templates/bp-nouveau/buddypress/members/single/activity.php
r12082 r12907 4 4 * 5 5 * @since 3.0.0 6 * @version 3.0.06 * @version 8.0.0 7 7 */ 8 9 8 ?> 10 9 … … 31 30 <div id="bp-ajax-loader"><?php bp_nouveau_user_feedback( 'member-activity-loading' ); ?></div> 32 31 33 <ul class="<?php bp_nouveau_loop_classes(); ?>" > 34 35 </ul> 32 <ul class="<?php bp_nouveau_loop_classes(); ?>"></ul> 36 33 37 34 </div><!-- .activity --> -
trunk/src/bp-templates/bp-nouveau/includes/activity/loader.php
r12192 r12907 4 4 * 5 5 * @since 3.0.0 6 * @version 3.0.06 * @version 8.0.0 7 7 */ 8 8 … … 16 16 */ 17 17 class BP_Nouveau_Activity { 18 /** 19 * Nouveau Activity directory. 20 * 21 * @since 3.0.0 22 * @var string 23 */ 24 public $dir = ''; 25 26 /** 27 * RSS feed link data. 28 * 29 * @since 3.0.0 30 * @var string 31 */ 32 public $current_rss_feed = array(); 33 18 34 /** 19 35 * Constructor -
trunk/src/bp-templates/bp-nouveau/includes/activity/template-tags.php
r12358 r12907 4 4 * 5 5 * @since 3.0.0 6 * @version 5.0.06 * @version 8.0.0 7 7 */ 8 8 … … 913 913 return $return; 914 914 } 915 916 /** 917 * Outputs the Activity RSS link. 918 * 919 * @since 8.0.0 920 */ 921 function bp_nouveau_activity_rss_link() { 922 echo esc_url( bp_nouveau_activity_get_rss_link() ); 923 } 924 925 /** 926 * Returns the Activity RSS link. 927 * 928 * @since 8.0.0 929 * 930 * @return string The Activity RSS link. 931 */ 932 function bp_nouveau_activity_get_rss_link() { 933 $bp_nouveau = bp_nouveau(); 934 $link = ''; 935 936 if ( isset( $bp_nouveau->activity->current_rss_feed['link'] ) ) { 937 $link = $bp_nouveau->activity->current_rss_feed['link']; 938 } 939 940 /** 941 * Filter here to edit the Activity RSS link. 942 * 943 * @since 8.0.0 944 * 945 * @param string The Activity RSS link. 946 */ 947 return apply_filters( 'bp_nouveau_activity_get_rss_link', $link ); 948 } 949 950 /** 951 * Outputs the Activity RSS Tooltip. 952 * 953 * @since 8.0.0 954 */ 955 function bp_nouveau_activity_rss_tooltip() { 956 echo esc_attr( bp_nouveau_activity_get_rss_tooltip() ); 957 } 958 959 /** 960 * Returns the Activity RSS Tooltip. 961 * 962 * @since 8.0.0 963 * 964 * @return string The Activity RSS Tooltip. 965 */ 966 function bp_nouveau_activity_get_rss_tooltip() { 967 $bp_nouveau = bp_nouveau(); 968 $tooltip = ''; 969 970 if ( isset( $bp_nouveau->activity->current_rss_feed['tooltip'] ) ) { 971 $tooltip = $bp_nouveau->activity->current_rss_feed['tooltip']; 972 } 973 974 /** 975 * Filter here to edit the Activity RSS Tooltip. 976 * 977 * @since 8.0.0 978 * 979 * @param string The Activity RSS Tooltip. 980 */ 981 return apply_filters( 'bp_nouveau_activity_get_rss_tooltip', $tooltip ); 982 } 983 984 /** 985 * Outputs the Activity RSS screen reader text. 986 * 987 * @since 8.0.0 988 */ 989 function bp_nouveau_activity_rss_screen_reader_text() { 990 echo esc_attr( bp_nouveau_activity_get_rss_screen_reader_text() ); 991 } 992 993 /** 994 * Returns the Activity RSS screen reader text. 995 * 996 * @since 8.0.0 997 * 998 * @return string The Activity RSS screen reader text. 999 */ 1000 function bp_nouveau_activity_get_rss_screen_reader_text() { 1001 $bp_nouveau = bp_nouveau(); 1002 $screen_reader_text = ''; 1003 1004 if ( isset( $bp_nouveau->activity->current_rss_feed['tooltip'] ) ) { 1005 $screen_reader_text = $bp_nouveau->activity->current_rss_feed['tooltip']; 1006 } 1007 1008 /** 1009 * Filter here to edit the Activity RSS screen reader text. 1010 * 1011 * @since 8.0.0 1012 * 1013 * @param string The Activity RSS screen reader text. 1014 */ 1015 return apply_filters( 'bp_nouveau_activity_get_rss_screen_reader_text', $screen_reader_text ); 1016 } -
trunk/src/bp-templates/bp-nouveau/includes/template-tags.php
r12892 r12907 4 4 * 5 5 * @since 3.0.0 6 * @version 8.0.06 * @version 7.0.0 7 7 */ 8 8 … … 2691 2691 <?php 2692 2692 } 2693 2694 /** 2695 * Checks whether the Activity RSS links should be output. 2696 * 2697 * @since 8.0.0 2698 * 2699 * @return bool True to output the Activity RSS link. False otherwise. 2700 */ 2701 function bp_nouveau_is_feed_enable() { 2702 $retval = false; 2703 $bp_nouveau = bp_nouveau(); 2704 2705 if ( bp_is_active( 'activity' ) && 'activity' === bp_current_component() ) { 2706 if ( isset( $bp_nouveau->activity->current_rss_feed ) ) { 2707 $bp_nouveau->activity->current_rss_feed = array( 2708 'link' => '', 2709 'tooltip' => _x( 'RSS Feed', 'BP RSS Tooltip', 'buddypress' ), 2710 'screen_reader_text' => _x( 'RSS', 'BP RSS screen reader text', 'buddypress' ), 2711 ); 2712 2713 if ( ! bp_is_user() && ! bp_is_group() ) { 2714 $retval = bp_activity_is_feed_enable( 'sitewide' ); 2715 2716 if ( $retval ) { 2717 $bp_nouveau->activity->current_rss_feed['link'] = bp_get_sitewide_activity_feed_link(); 2718 } 2719 } elseif ( bp_is_user_activity() ) { 2720 $retval = bp_activity_is_feed_enable( 'personal' ); 2721 2722 if ( $retval ) { 2723 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/feed' ); 2724 } 2725 2726 if ( bp_is_active( 'friends' ) && bp_is_current_action( bp_get_friends_slug() ) ) { 2727 $retval = bp_activity_is_feed_enable( 'friends' ); 2728 2729 if ( $retval ) { 2730 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed' ); 2731 } 2732 } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) { 2733 $retval = bp_activity_is_feed_enable( 'mygroups' ); 2734 2735 if ( $retval ) { 2736 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed' ); 2737 } 2738 } elseif ( bp_activity_do_mentions() && bp_is_current_action( 'mentions' ) ) { 2739 $retval = bp_activity_is_feed_enable( 'mentions' ); 2740 2741 if ( $retval ) { 2742 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/mentions/feed' ); 2743 } 2744 } elseif ( bp_activity_can_favorite() && bp_is_current_action( 'favorites' ) ) { 2745 $retval = bp_activity_is_feed_enable( 'mentions' ); 2746 2747 if ( $retval ) { 2748 $bp_nouveau->activity->current_rss_feed['link'] = trailingslashit( bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed' ); 2749 } 2750 } 2751 } 2752 } 2753 } 2754 2755 return $retval; 2756 } -
trunk/src/bp-templates/bp-nouveau/js/buddypress-activity.js
r12856 r12907 65 65 // Inject Activities 66 66 $( '#buddypress [data-bp-list="activity"]' ).on( 'click', 'li.load-newest, li.load-more', this.injectActivities.bind( this ) ); 67 $( '#buddypress [data-bp-list]' ).on( 'bp_ajax_request', this.updateRssLink ); 67 68 68 69 // Hightlight new activities & clean up the stream … … 834 835 $( element ).closest( 'form' ).find( '[type=submit]' ).first().trigger( 'click' ); 835 836 } 837 }, 838 839 updateRssLink: function( event, data ) { 840 var rssLink = data.response.feed_url || ''; 841 842 if ( rssLink && $( '#activity-rss-feed' ).length ) { 843 $( '#activity-rss-feed' ).find( 'a' ).first().prop( 'href', rssLink ); 844 } 836 845 } 837 846 };
Note: See TracChangeset
for help on using the changeset viewer.