Changeset 3265 for branches/plugin/bbp-includes/bbp-topic-functions.php
- Timestamp:
- 05/29/2011 01:51:02 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-topic-functions.php
r3243 r3265 41 41 * @uses bbp_unstick_topic() To unstick the topic 42 42 * @uses bbp_get_topic_permalink() To get the topic permalink 43 * @uses wp_ redirect() To redirect to the topic link43 * @uses wp_safe_redirect() To redirect to the topic link 44 44 * @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error 45 45 * messages … … 240 240 /** Redirect **************************************************/ 241 241 242 $topic_url = bbp_get_topic_permalink( $topic_id ); 243 244 if ( $bbp->trash_status_id == $topic_data['post_status'] ) 242 // Redirect to 243 $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; 244 245 // View all? 246 $count_hidden = (bool) ( !empty( $_GET['view'] ) && ( 'all' == $_GET['view'] ) || ( $topic_data['post_status'] == $bbp->trash_status_id ) ); 247 248 // Get the topic URL 249 $topic_url = bbp_get_topic_permalink( $topic_id, $redirect_to ); 250 251 // Add view all? 252 if ( !empty( $count_hidden ) ) 245 253 $topic_url = add_query_arg( array( 'view' => 'all' ), $topic_url ); 246 254 247 $topic_url = apply_filters( 'bbp_new_topic_redirect_to', $topic_url ); 255 // Allow to be filtered 256 $topic_url = apply_filters( 'bbp_new_topic_redirect_to', $topic_url, $count_hidden, $redirect_to ); 248 257 249 258 /** Successful Save *******************************************/ 250 259 251 260 // Redirect back to new topic 252 wp_ redirect( $topic_url );261 wp_safe_redirect( $topic_url ); 253 262 254 263 // For good measure … … 294 303 * to another 295 304 * @uses bbp_get_topic_permalink() To get the topic permalink 296 * @uses wp_ redirect() To redirect to the topic link305 * @uses wp_safe_redirect() To redirect to the topic link 297 306 * @uses bbPress::errors::get_error_messages() To get the {@link WP_Error} error 298 307 * messages … … 504 513 do_action( 'bbp_edit_topic_post_extras', $topic_id ); 505 514 515 /** Redirect **************************************************/ 516 517 // Redirect to 518 $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; 519 520 // View all? 521 $count_hidden = (bool) ( !empty( $_GET['view'] ) && ( 'all' == $_GET['view'] ) ); 522 523 // Get the topic URL 524 $topic_url = bbp_get_topic_permalink( $topic_id, $redirect_to ); 525 526 // Add view all? 527 if ( !empty( $count_hidden ) ) 528 $topic_url = add_query_arg( array( 'view' => 'all' ), $topic_url ); 529 530 // Allow to be filtered 531 $topic_url = apply_filters( 'bbp_edit_topic_redirect_to', $topic_url, $count_hidden, $redirect_to ); 532 506 533 /** Successful Edit *******************************************/ 507 534 508 535 // Redirect back to new topic 509 wp_ redirect( bbp_get_topic_permalink( $topic_id ));536 wp_safe_redirect( $topic_url ); 510 537 511 538 // For good measure
Note: See TracChangeset
for help on using the changeset viewer.