Ticket #3051: 3051.patch
| File 3051.patch, 2.2 KB (added by , 9 years ago) |
|---|
-
src/includes/topics/functions.php
2329 2329 case 'trash': 2330 2330 check_ajax_referer( "trash-{$nonce_suffix}" ); 2331 2331 2332 $retval['view_all'] = true; 2333 $retval['status'] = wp_trash_post( $r['id'] ); 2334 $retval['message'] = __( '<strong>ERROR</strong>: There was a problem trashing the topic.', 'bbpress' ); 2332 $retval['view_all'] = true; 2333 $retval['status'] = wp_trash_post( $r['id'] ); 2334 $retval['message'] = __( '<strong>ERROR</strong>: There was a problem trashing the topic.', 'bbpress' ); 2335 $retval['redirect_to'] = bbp_get_topic_permalink( $r['id'] ); 2335 2336 2336 2337 break; 2337 2338 … … 2338 2339 case 'untrash': 2339 2340 check_ajax_referer( "untrash-{$nonce_suffix}" ); 2340 2341 2341 $retval['status'] = wp_untrash_post( $r['id'] ); 2342 $retval['message'] = __( '<strong>ERROR</strong>: There was a problem untrashing the topic.', 'bbpress' ); 2342 $retval['status'] = wp_untrash_post( $r['id'] ); 2343 $retval['message'] = __( '<strong>ERROR</strong>: There was a problem untrashing the topic.', 'bbpress' ); 2344 $retval['redirect_to'] = bbp_get_topic_permalink( $r['id'] ); 2343 2345 2344 2346 break; 2345 2347 … … 2346 2348 case 'delete': 2347 2349 check_ajax_referer( "delete-{$nonce_suffix}" ); 2348 2350 2349 $retval['status'] = wp_delete_post( $r['id'] ); 2350 $retval['message'] = __( '<strong>ERROR</strong>: There was a problem deleting the topic.', 'bbpress' ); 2351 $retval['status'] = wp_delete_post( $r['id'] ); 2352 $retval['message'] = __( '<strong>ERROR</strong>: There was a problem deleting the topic.', 'bbpress' ); 2353 $retval['redirect_to'] = bbp_get_forum_permalink( $retval['status']->post_parent ); 2351 2354 2352 2355 break; 2353 2356 } … … 2355 2358 break; 2356 2359 } 2357 2360 2358 // Maybe redirect back to the topic's forum2359 if ( isset( $r['sub_action'] ) && ( 'delete' === $r['sub_action'] ) ) {2360 $retval['redirect_to'] = bbp_get_forum_permalink( $retval['status']->post_parent );2361 }2362 2363 2361 // Add view all if needed 2364 2362 if ( ! empty( $retval['view_all'] ) ) { 2365 2363 $retval['redirect_to'] = bbp_add_view_all( $retval['redirect_to'], true );