Making WordPress.org

Changeset 3835


Ignore:
Timestamp:
08/22/2016 04:34:00 PM (9 years ago)
Author:
iandunn
Message:

WordCamp Coming Soon Page: Fix broken menu link.

This bug didn't exist in the original patch, but was introduced during the review phase, because I didn't connect the dots between register_settings_pages() and get_customizer_section_url(), and thought it'd be better to use an absolute URL.

The bug didn't show up during local testing because of differences between the nginx configuration on my sandbox and the config on production, and I failed to test production after deploying.

This commit reverts it back to a relative URL so that it will work again, and also moves it inside register_settings_pages() to avoid confusing it with a complete URL that would be safe to use in other contexts.

See #334
Props ryelle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-coming-soon-page/classes/wccsp-settings.php

    r3784 r3835  
    5151
    5252    /**
    53      * Get the URL for the Coming Soon section in the Customizer
    54      *
    55      * @return string
    56      */
    57     public function get_customizer_section_url() {
    58         $url = add_query_arg(
    59             array(
    60                 'autofocus[section]' => 'wccsp_live_preview',
    61                 'url'                => rawurlencode( add_query_arg( 'wccsp-preview', '', site_url() ) ),
    62             ),
    63             admin_url( 'customize.php' )
    64         );
    65 
    66         return $url;
    67     }
    68 
    69     /**
    7053     * Add a link to the Settings menu
    7154     *
     
    7457     */
    7558    public function register_settings_pages() {
     59        $menu_slug = add_query_arg(
     60            array(
     61                'autofocus[section]' => 'wccsp_live_preview',
     62                'url'                => rawurlencode( add_query_arg( 'wccsp-preview', '', site_url() ) ),
     63            ),
     64            '/customize.php'
     65        );
     66
    7667        add_submenu_page(
    7768            'options-general.php',
     
    7970            __( 'Coming Soon', 'wordcamporg' ),
    8071            self::REQUIRED_CAPABILITY,
    81             $this->get_customizer_section_url()
     72            $menu_slug
    8273        );
    8374    }
Note: See TracChangeset for help on using the changeset viewer.