Ticket #2622: 2622.diff
| File 2622.diff, 3.4 KB (added by , 12 years ago) |
|---|
-
src/includes/admin/topics.php
502 502 503 503 $is_sticky = bbp_is_topic_sticky( $topic_id ); 504 504 $is_super = false === $is_sticky && !empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false; 505 $message = true === $is_sticky ? 'unst icked' : 'sticked';506 $message = true === $is_super ? 'super_stick ed' : $message;505 $message = true === $is_sticky ? 'unstuck' : 'stuck'; 506 $message = true === $is_super ? 'super_sticky' : $message; 507 507 $success = true === $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super ); 508 508 509 509 break; … … 554 554 if ( $this->bail() ) return; 555 555 556 556 // Only proceed if GET is a topic toggle action 557 if ( bbp_is_get_request() && !empty( $_GET['bbp_topic_toggle_notice'] ) && in_array( $_GET['bbp_topic_toggle_notice'], array( 'opened', 'closed', 'super_stick ed', 'sticked', 'unsticked', 'spammed', 'unspammed' ) ) && !empty( $_GET['topic_id'] ) ) {557 if ( bbp_is_get_request() && !empty( $_GET['bbp_topic_toggle_notice'] ) && in_array( $_GET['bbp_topic_toggle_notice'], array( 'opened', 'closed', 'super_sticky', 'stuck', 'unstuck', 'spammed', 'unspammed' ) ) && !empty( $_GET['topic_id'] ) ) { 558 558 $notice = $_GET['bbp_topic_toggle_notice']; // Which notice? 559 559 $topic_id = (int) $_GET['topic_id']; // What's the topic id? 560 560 $is_failure = !empty( $_GET['failed'] ) ? true : false; // Was that a failure? … … 579 579 $message = $is_failure === true ? sprintf( __( 'There was a problem closing the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully closed.', 'bbpress' ), $topic_title ); 580 580 break; 581 581 582 case 'super_stick ed' :583 $message = $is_failure === true ? sprintf( __( 'There was a problem sticking the topic "%1$s" to front.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully st ickedto front.', 'bbpress' ), $topic_title );582 case 'super_sticky' : 583 $message = $is_failure === true ? sprintf( __( 'There was a problem sticking the topic "%1$s" to front.', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully stuck to front.', 'bbpress' ), $topic_title ); 584 584 break; 585 585 586 case 'st icked' :587 $message = $is_failure === true ? sprintf( __( 'There was a problem sticking the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully st icked.', 'bbpress' ), $topic_title );586 case 'stuck' : 587 $message = $is_failure === true ? sprintf( __( 'There was a problem sticking the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully stuck.', 'bbpress' ), $topic_title ); 588 588 break; 589 589 590 case 'unst icked' :591 $message = $is_failure === true ? sprintf( __( 'There was a problem unsticking the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unst icked.', 'bbpress' ), $topic_title );590 case 'unstuck' : 591 $message = $is_failure === true ? sprintf( __( 'There was a problem unsticking the topic "%1$s".', 'bbpress' ), $topic_title ) : sprintf( __( 'Topic "%1$s" successfully unstuck.', 'bbpress' ), $topic_title ); 592 592 break; 593 593 594 594 case 'spammed' :