Making WordPress.org

Changeset 7987


Ignore:
Timestamp:
12/18/2018 02:30:14 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Support Hub: Redirect "Update PHP" page from the old slug to the new one.

The old slug is upgrade-php, the new one is update-php.

Fixes #4005.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php

    r7875 r7987  
    1515        add_filter( 'bbp_map_meta_caps',              array( $this, 'disallow_editing_past_lock_time' ), 10, 4 );
    1616        add_filter( 'redirect_canonical',             array( $this, 'disable_redirect_guess_404_permalink' ) );
     17        add_action( 'template_redirect',              array( $this, 'redirect_update_php_page' ) );
    1718        add_filter( 'wp_insert_post_data',            array( $this, 'set_post_date_gmt_for_pending_posts' ) );
    1819        add_action( 'wp_print_footer_scripts',        array( $this, 'replace_quicktags_blockquote_button' ) );
     
    181182
    182183        return $redirect_url;
     184    }
     185
     186    /**
     187     * Redirect "Update PHP" page from the old slug to the new one.
     188     *
     189     * The old slug is 'upgrade-php', the new one is 'update-php'.
     190     */
     191    public function redirect_update_php_page() {
     192        if ( is_404() && 'upgrade-php' === get_query_var( 'pagename' ) ) {
     193            wp_redirect( home_url( '/update-php/' ), 301 );
     194            exit;
     195        }
    183196    }
    184197
Note: See TracChangeset for help on using the changeset viewer.