Ticket #6504: 6504.diff
File 6504.diff, 3.3 KB (added by , 10 years ago) |
---|
-
src/bp-templates/bp-legacy/buddypress-functions.php
134 134 } 135 135 136 136 /** Ajax **************************************************************/ 137 //these ajax actions don't require users to be logged in 138 $non_privileged_actions = array( 137 139 138 $actions = array(139 140 140 // Directory filters 141 141 'blogs_filter' => 'bp_legacy_theme_object_template_loader', 142 142 'forums_filter' => 'bp_legacy_theme_object_template_loader', 143 143 'groups_filter' => 'bp_legacy_theme_object_template_loader', 144 144 'members_filter' => 'bp_legacy_theme_object_template_loader', 145 146 // Activity 147 'activity_get_older_updates' => 'bp_legacy_theme_activity_template_loader', 148 'activity_widget_filter' => 'bp_legacy_theme_activity_template_loader', 149 'get_single_activity_content' => 'bp_legacy_theme_get_single_activity_content', 150 151 ); 152 153 154 155 /** 156 * Register all of these AJAX handlers 157 * 158 * The "wp_ajax_" action is used for logged in users, and "wp_ajax_nopriv_" 159 * executes for users that aren't logged in. This is for backpat with BP <1.6. 160 */ 161 foreach( $non_privileged_actions as $name => $function ) { 162 //we need these actions for both the logged in as well as logged out users 163 add_action( 'wp_ajax_' . $name, $function ); 164 add_action( 'wp_ajax_nopriv_' . $name, $function ); 165 } 166 167 //only for logged in users 168 $actions = array( 169 145 170 'messages_filter' => 'bp_legacy_theme_messages_template_loader', 146 171 'invite_filter' => 'bp_legacy_theme_invite_template_loader', 147 172 'requests_filter' => 'bp_legacy_theme_requests_template_loader', … … 152 177 'reject_friendship' => 'bp_legacy_theme_ajax_reject_friendship', 153 178 154 179 // Activity 155 'activity_get_older_updates' => 'bp_legacy_theme_activity_template_loader',156 180 'activity_mark_fav' => 'bp_legacy_theme_mark_activity_favorite', 157 181 'activity_mark_unfav' => 'bp_legacy_theme_unmark_activity_favorite', 158 'activity_widget_filter' => 'bp_legacy_theme_activity_template_loader',159 182 'delete_activity' => 'bp_legacy_theme_delete_activity', 160 183 'delete_activity_comment' => 'bp_legacy_theme_delete_activity_comment', 161 'get_single_activity_content' => 'bp_legacy_theme_get_single_activity_content',162 184 'new_activity_comment' => 'bp_legacy_theme_new_activity_comment', 163 185 'post_update' => 'bp_legacy_theme_post_update', 164 186 'bp_spam_activity' => 'bp_legacy_theme_spam_activity', … … 181 203 if ( bp_is_active( 'messages', 'star' ) ) { 182 204 $actions['messages_star'] = 'bp_legacy_theme_ajax_messages_star_handler'; 183 205 } 184 185 /** 186 * Register all of these AJAX handlers 187 * 188 * The "wp_ajax_" action is used for logged in users, and "wp_ajax_nopriv_" 189 * executes for users that aren't logged in. This is for backpat with BP <1.6. 190 */ 206 191 207 foreach( $actions as $name => $function ) { 192 208 add_action( 'wp_ajax_' . $name, $function ); 193 add_action( 'wp_ajax_nopriv_' . $name, $function );194 209 } 195 210 196 211 add_filter( 'bp_ajax_querystring', 'bp_legacy_theme_ajax_querystring', 10, 2 );