| 319 | /** |
| 320 | * Correct reply URLs for pending posts, see #meta2478. |
| 321 | */ |
| 322 | function wporg_support_fix_pending_posts_reply_url( $url, $post_id ) { |
| 323 | if ( false !== strpos( $url, '?' ) && false !== strpos( $url, '/edit/' ) ) { |
| 324 | $url = str_replace( '/edit/', '', $url ); |
| 325 | $url = add_query_arg( 'edit', '1', $url ); |
| 326 | } |
| 327 | |
| 328 | return $url; |
| 329 | } |
| 330 | add_filter( 'bbp_get_topic_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 ); |
| 331 | add_filter( 'bbp_get_reply_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 ); |
| 332 | |