Make WordPress Core

Ticket #31850: 31850.3.diff

File 31850.3.diff, 2.8 KB (added by westonruter, 8 years ago)

Refresh patch

  • src/wp-admin/includes/theme.php

    diff --git src/wp-admin/includes/theme.php src/wp-admin/includes/theme.php
    index 822fb5b656..c5de5e5c9c 100644
    function wp_prepare_themes_for_js( $themes = null ) { 
    578578                if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
    579579                        $customize_action = esc_url( add_query_arg(
    580580                                array(
    581                                         'return' => urlencode( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),
     581                                        'return' => urlencode( esc_url_raw( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ),
    582582                                ),
    583583                                wp_customize_url( $slug )
    584584                        ) );
  • src/wp-admin/menu.php

    diff --git src/wp-admin/menu.php src/wp-admin/menu.php
    index f258e5639b..42a26ddfcb 100644
    $appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_t 
    157157$menu[60] = array( __( 'Appearance' ), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
    158158        $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' );
    159159
    160         $customize_url = add_query_arg( 'return', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'customize.php' );
     160        $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ), 'customize.php' );
    161161        $submenu['themes.php'][6] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
    162162
    163163        if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) {
  • src/wp-admin/nav-menus.php

    diff --git src/wp-admin/nav-menus.php src/wp-admin/nav-menus.php
    index 974d910d20..d8fc77f01d 100644
    require_once( ABSPATH . 'wp-admin/admin-header.php' ); 
    584584                        ' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
    585585                        esc_url( add_query_arg( array(
    586586                                array( 'autofocus' => $focus ),
    587                                 'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
     587                                'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),
    588588                        ), admin_url( 'customize.php' ) ) ),
    589589                        __( 'Manage with Live Preview' )
    590590                );
  • src/wp-admin/widgets.php

    diff --git src/wp-admin/widgets.php src/wp-admin/widgets.php
    index 8793cab2d5..db4459b387 100644
    if ( current_user_can( 'customize' ) ) { 
    357357                esc_url( add_query_arg(
    358358                        array(
    359359                                array( 'autofocus' => array( 'panel' => 'widgets' ) ),
    360                                 'return' => urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) )
     360                                'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) )
    361361                        ),
    362362                        admin_url( 'customize.php' )
    363363                ) ),