- Timestamp:
- 05/26/2018 12:49:25 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/src/bp-templates/bp-nouveau/includes/messages/ajax.php
r12122 r12134 224 224 } 225 225 226 if ( isset( $_POST['box'] ) && 'starred' === $_POST['box'] ) { 227 $star_filter = true; 228 229 // Add the message thread filter. 226 $bp = buddypress(); 227 $reset_action = $bp->current_action; 228 229 // Override bp_current_action(). 230 if ( isset( $_POST['box'] ) ) { 231 $bp->current_action = $_POST['box']; 232 } 233 234 // Add the message thread filter. 235 if ( 'starred' === $bp->current_action ) { 230 236 add_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_filter_starred_message_threads' ); 231 237 } … … 233 239 // Simulate the loop. 234 240 if ( ! bp_has_message_threads( bp_ajax_querystring( 'messages' ) ) ) { 241 // Remove the bp_current_action() override. 242 $bp->current_action = $reset_action; 243 235 244 wp_send_json_error( array( 236 245 'feedback' => __( 'Sorry, no messages were found.', 'buddypress' ), … … 239 248 } 240 249 241 if ( ! empty( $star_filter ) ) {242 // remove the message thread filter.250 // remove the message thread filter. 251 if ( 'starred' === $bp->current_action ) { 243 252 remove_filter( 'bp_after_has_message_threads_parse_args', 'bp_messages_filter_starred_message_threads' ); 244 253 } … … 320 329 $threads->threads = array_filter( $threads->threads ); 321 330 331 $extra_content = bp_nouveau_messages_catch_hook_content( array( 332 'beforeLoop' => 'bp_before_member_messages_loop', 333 'afterLoop' => 'bp_after_member_messages_loop', 334 ) ); 335 336 if ( array_filter( $extra_content ) ) { 337 $threads->extraContent = $extra_content; 338 } 339 340 // Remove the bp_current_action() override. 341 $bp->current_action = $reset_action; 342 343 // Return the successfull reply. 322 344 wp_send_json_success( $threads ); 323 345 }
Note: See TracChangeset
for help on using the changeset viewer.