Ticket #1988: 1988.diff
File 1988.diff, 3.6 KB (added by , 9 years ago) |
---|
-
src/includes/common/template.php
2527 2527 <?php endif; 2528 2528 } 2529 2529 2530 /** 2531 * Display a notice to the user at the top of the page 2532 */ 2533 2534 function bbp_posting_notices(){ 2535 2536 $query_args = $_GET; 2537 $bbpid = $_GET['bbpid']; 2538 2539 // If the post id has been passed through, get the type if possible otherwise assume 'post' 2540 if( !empty( $bbpid ) ){ 2541 $post_type = ( get_post_type( (int)$bbpid ) ) ? get_post_type( (int)$bbpid ) : '<<em>not a valid post id</em>>'; 2542 } 2543 else{ 2544 $post_type = 'post'; 2545 } 2546 2547 foreach( $query_args as $param => $arg ){ 2548 2549 if( $param =='pending' ){ 2550 $notices[] = __( 'Your ' . $post_type . ' has been submitted successfully and is pending moderator approval.', 'bbpress' ); 2551 } 2552 if( $param == 'test' ){ 2553 $notices[] = __( 'This is a test, this is only a test.', 'bbpress' ); 2554 } 2555 2556 } 2557 2558 $notices = apply_filters( 'bbp_posting_notices', $notices, $post_type ); 2559 2560 if( !empty( $notices ) ){ 2561 2562 $notice_list = '<div class="bbp-template-notice error">'; 2563 $notice_list .= '<ul>'; 2564 2565 foreach( $notices as $notice ){ 2566 2567 $notice_list .= '<li>' . $notice . '</li>'; 2568 } 2569 2570 $notice_list .= '</ul>'; 2571 $notice_list .= '</div>'; 2572 2573 echo $notice_list; 2574 } 2575 2576 } 2577 2530 2578 /** Login/logout/register/lost pass *******************************************/ 2531 2579 2532 2580 /** -
src/includes/core/actions.php
155 155 add_action( 'bbp_template_notices', 'bbp_notice_edit_user_success' ); 156 156 add_action( 'bbp_template_notices', 'bbp_notice_edit_user_is_super_admin', 2 ); 157 157 158 // Notice that the post (topic or reply) is pending 159 add_action( 'bbp_template_before_single_topic', 'bbp_posting_notices' ); 160 add_action( 'bbp_template_before_single_forum', 'bbp_posting_notices' ); 161 162 158 163 // Before Delete/Trash/Untrash Forum 159 164 add_action( 'wp_trash_post', 'bbp_trash_forum' ); 160 165 add_action( 'trash_post', 'bbp_trash_forum' ); -
src/includes/replies/functions.php
443 443 // Get the reply URL 444 444 $reply_url = bbp_get_reply_url( $reply_id, $redirect_to ); 445 445 446 // If it is pending, add the pending query arg 447 $reply_url = ( $reply_status != bbp_get_pending_status_id() ) ? $reply_url : add_query_arg( array('pending' => 'true'), $reply_url ); 448 446 449 // Allow to be filtered 447 450 $reply_url = apply_filters( 'bbp_new_reply_redirect_to', $reply_url, $redirect_to, $reply_id ); 448 451 -
src/includes/topics/functions.php
405 405 // Redirect to 406 406 $redirect_to = bbp_get_redirect_to(); 407 407 408 // Get the topic URL 409 $redirect_url = bbp_get_topic_permalink( $topic_id, $redirect_to ); 408 // If it is pending, add the pending query arg to the forum permalink 409 $forum_url = bbp_get_forum_permalink( $forum_id ); 410 $topic_url = bbp_get_topic_permalink( $topic_id, $redirect_to ); 411 $redirect_url = ( $topic_status != bbp_get_pending_status_id() ) ? $topic_url : add_query_arg( array('pending' => 'true'), $forum_url ); 410 412 413 411 414 // Add view all? 412 415 if ( bbp_get_view_all() || ! empty( $view_all ) ) { 413 416