Ticket #3353: 3353.reply.patch
| File 3353.reply.patch, 1.7 KB (added by , 6 years ago) |
|---|
-
src/includes/replies/functions.php
322 322 if ( bbp_is_topic_pending( $topic_id ) || ! bbp_check_for_moderation( $anonymous_data, $reply_author, $reply_title, $reply_content ) ) { 323 323 $reply_status = bbp_get_pending_status_id(); 324 324 325 // Add an error notice. 326 bbp_add_error( 'bbp_reply_moderated', __( 'Your reply is pending moderation.', 'bbpress' ) ); 327 325 328 // Default 326 329 } else { 327 330 $reply_status = bbp_get_public_status_id(); … … 465 468 /** Successful Save ***************************************************/ 466 469 467 470 // Redirect back to new reply 468 bbp_redirect( $reply_url ); 471 if ( bbp_get_pending_status_id() !== $reply_status ) { 472 bbp_redirect( $reply_url ); 473 } 469 474 470 475 /** Errors ****************************************************************/ 471 476 -
src/includes/replies/template.php
2453 2453 * @return string Value of reply content field 2454 2454 */ 2455 2455 function bbp_get_form_reply_content() { 2456 $reply_content = ''; 2456 2457 2457 2458 // Get _POST data 2458 if ( bbp_is_reply_form_post_request() && isset( $_POST['bbp_reply_content'] ) ) {2459 if ( bbp_is_reply_form_post_request() && ! bbp_has_errors() && isset( $_POST['bbp_reply_content'] ) ) { 2459 2460 $reply_content = wp_unslash( $_POST['bbp_reply_content'] ); 2460 2461 2461 2462 // Get edit data 2462 2463 } elseif ( bbp_is_reply_edit() ) { 2463 2464 $reply_content = bbp_get_global_post_field( 'post_content', 'raw' ); 2464 2465 // No data2466 } else {2467 $reply_content = '';2468 2465 } 2469 2466 2470 2467 // Filter & return