Making WordPress.org


Ignore:
Timestamp:
02/16/2017 04:02:48 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Support Theme: After [4892], adjust the workaround for pending post edit URLs to also account for %2Fedit%2F, in addition to /edit/.

The /edit/ argument is encoded if view=all was appended to the URL via bbp_add_view_all().

See #2478.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/functions.php

    r4905 r4910  
    314314 */
    315315function wporg_support_fix_pending_posts_reply_url( $url, $post_id ) {
    316         if ( false !== strpos( $url, '?' ) && false !== strpos( $url, '/edit/' ) ) {
    317                 $url = str_replace( '/edit/', '', $url );
    318                 $url = add_query_arg( 'edit', '1', $url );
     316        if ( false !== strpos( $url, '?' ) ) {
     317                if ( false !== strpos( $url, '/edit/' ) ) {
     318                        $url = str_replace( '/edit/', '', $url );
     319                        $url = add_query_arg( 'edit', '1', $url );
     320                } elseif ( false !== strpos( $url, '%2Fedit%2F' ) ) {
     321                        $url = str_replace( '%2Fedit%2F', '', $url );
     322                        $url = add_query_arg( 'edit', '1', $url );
     323                }
    319324        }
    320325
Note: See TracChangeset for help on using the changeset viewer.