Making WordPress.org

Ticket #2478: meta-2478.patch

File meta-2478.patch, 1.1 KB (added by SergeyBiryukov, 8 years ago)
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

     
    316316}
    317317add_filter( 'bbp_topic_admin_links', 'wporg_support_change_super_sticky_text' );
    318318
     319/**
     320 * Correct reply URLs for pending posts, see #meta2478.
     321 */
     322function 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}
     330add_filter( 'bbp_get_topic_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 );
     331add_filter( 'bbp_get_reply_edit_url', 'wporg_support_fix_pending_posts_reply_url', 10, 2 );
     332
    319333/** bb Base *******************************************************************/
    320334
    321335function bb_base_search_form() {