Changeset 3265 for branches/plugin/bbp-includes/bbp-reply-functions.php
- Timestamp:
- 05/29/2011 01:51:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-reply-functions.php
r3255 r3265 134 134 * id, anonymous data and reply author 135 135 * @uses bbp_get_reply_url() To get the paginated url to the reply 136 * @uses wp_ redirect() To redirect to the reply url136 * @uses wp_safe_redirect() To redirect to the reply url 137 137 * @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error 138 138 * message … … 304 304 /** Redirect **************************************************/ 305 305 306 $reply_url = bbp_get_reply_url( $reply_id ); 307 308 if ( ( !empty( $_GET['view'] ) && ( 'all' === $_GET['view'] ) ) || ( $reply_data['post_status'] == $bbp->trash_status_id ) ) 306 // Redirect to 307 $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; 308 309 // View all? 310 $count_hidden = (bool) ( !empty( $_GET['view'] ) && ( 'all' == $_GET['view'] ) || ( $reply_data['post_status'] == $bbp->trash_status_id ) ); 311 312 // Get the reply URL 313 $reply_url = bbp_get_reply_url( $reply_id, $count_hidden, $redirect_to ); 314 315 // Add view all? 316 if ( !empty( $count_hidden ) ) 309 317 $reply_url = add_query_arg( array( 'view' => 'all' ), $reply_url ); 310 318 311 $reply_url = apply_filters( 'bbp_new_reply_redirect_to', $reply_url ); 319 // Allow to be filtered 320 $reply_url = apply_filters( 'bbp_new_reply_redirect_to', $reply_url, $count_hidden, $redirect_to ); 312 321 313 322 /** Successful Save *******************************************/ 314 323 315 324 // Redirect back to new reply 316 wp_ redirect( $reply_url );325 wp_safe_redirect( $reply_url ); 317 326 318 327 // For good measure … … 355 364 * id, anonymous data, reply author and bool true (for edit) 356 365 * @uses bbp_get_reply_url() To get the paginated url to the reply 357 * @uses wp_ redirect() To redirect to the reply url366 * @uses wp_safe_redirect() To redirect to the reply url 358 367 * @uses bbPress::errors::get_error_message() To get the {@link WP_Error} error 359 368 * message … … 525 534 do_action( 'bbp_edit_reply_post_extras', $reply_id ); 526 535 536 /** Redirect **************************************************/ 537 538 // Redirect to 539 $redirect_to = !empty( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; 540 541 // View all? 542 $count_hidden = (bool) ( !empty( $_GET['view'] ) && ( 'all' == $_GET['view'] ) ); 543 544 // Get the reply URL 545 $reply_url = bbp_get_reply_url( $reply_id, $count_hidden, $redirect_to ); 546 547 // Add view all? 548 if ( !empty( $count_hidden ) ) 549 $reply_url = add_query_arg( array( 'view' => 'all' ), $reply_url ); 550 551 // Allow to be filtered 552 $reply_url = apply_filters( 'bbp_edit_reply_redirect_to', $reply_url, $count_hidden, $redirect_to ); 553 527 554 /** Successful Edit *******************************************/ 528 555 529 556 // Redirect back to new reply 530 wp_ redirect( bbp_get_reply_url( $reply_id ));557 wp_safe_redirect( $reply_url ); 531 558 532 559 // For good measure
Note: See TracChangeset
for help on using the changeset viewer.