- Timestamp:
- 05/25/2018 03:52:08 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.0/src/bp-templates/bp-nouveau/includes/messages/ajax.php
r12105 r12122 135 135 } 136 136 137 // Get the message by epretending we're in the message loop.137 // Get the message by pretending we're in the message loop. 138 138 global $thread_template; 139 140 $bp = buddypress(); 141 $reset_action = $bp->current_action; 142 143 // Override bp_current_action(). 144 $bp->current_action = 'view'; 139 145 140 146 bp_thread_has_messages( array( 'thread_id' => (int) $_POST['thread_id'] ) ); … … 183 189 } 184 190 191 $extra_content = bp_nouveau_messages_catch_hook_content( array( 192 'beforeContent' => 'bp_before_message_content', 193 'afterContent' => 'bp_after_message_content', 194 ) ); 195 196 if ( array_filter( $extra_content ) ) { 197 $reply = array_merge( $reply, $extra_content ); 198 } 199 185 200 // Clean up the loop. 186 201 bp_thread_messages(); 202 203 // Remove the bp_current_action() override. 204 $bp->current_action = $reset_action; 187 205 188 206 wp_send_json_success( array( … … 357 375 } 358 376 359 $thread_id = (int) $_POST['id']; 377 $thread_id = (int) $_POST['id']; 378 $bp = buddypress(); 379 $reset_action = $bp->current_action; 380 381 // Override bp_current_action(). 382 $bp->current_action = 'view'; 360 383 361 384 // Simulate the loop. 362 385 if ( ! bp_thread_has_messages( array( 'thread_id' => $thread_id ) ) ) { 386 // Remove the bp_current_action() override. 387 $bp->current_action = $reset_action; 388 363 389 wp_send_json_error( $response ); 364 390 } … … 423 449 } 424 450 451 $extra_content = bp_nouveau_messages_catch_hook_content( array( 452 'beforeContent' => 'bp_before_message_content', 453 'afterContent' => 'bp_after_message_content', 454 ) ); 455 456 if ( array_filter( $extra_content ) ) { 457 $thread->messages[ $i ] = array_merge( $thread->messages[ $i ], $extra_content ); 458 } 459 425 460 $i += 1; 426 461 endwhile; 427 462 428 463 $thread->messages = array_filter( $thread->messages ); 464 465 // Remove the bp_current_action() override. 466 $bp->current_action = $reset_action; 429 467 430 468 wp_send_json_success( $thread );
Note: See TracChangeset
for help on using the changeset viewer.