WordPress.org

Making WordPress.org

Changeset 9535


Ignore:
Timestamp:
02/24/2020 11:44:33 PM (8 months ago)
Author:
dd32
Message:

Theme Directory: Redirect /themes/browse/featured to the homepage temporarily as we had incorrectly set it as the Canonical URL for the Theme directory.

See #5044.
Fixes #5048.

Location:
sites/trunk/wordpress.org/public_html/wp-content
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/theme-directory.php

    r9533 r9535  
    3434include __DIR__ . '/jobs/class-trac-sync.php';
    3535new WordPressdotorg\Theme_Directory\Jobs\Manager();
     36
     37define( 'WPORG_THEMES_DEFAULT_BROWSE', 'popular' );
    3638
    3739/**
     
    12851287    $link = false;
    12861288
    1287     if ( get_query_var( 'browse' ) ) {
     1289    if ( get_query_var( 'browse' ) && WPORG_THEMES_DEFAULT_BROWSE === get_query_var( 'browse' ) ) {
     1290        $link = home_url( '/' );
     1291    } elseif ( get_query_var( 'browse' ) ) {
    12881292        // The browse/% urls on the Theme directory are front-page-query alterations.
    12891293        $link = home_url( 'browse/' . get_query_var( 'browse' ) . '/' );
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php

    r9533 r9535  
    7676        );
    7777        wp_safe_redirect( $url, 301 );
     78        die();
     79    }
     80
     81    // Redirect /browse/featured/ to the front-page temporarily, as it's showing in Google results.
     82    if ( '/themes/browse/featured' === substr( $path, 0, 23 ) ) {
     83        wp_safe_redirect( home_url( '/' ), 302 );
    7884        die();
    7985    }
     
    137143                    'nonce'  => is_user_logged_in() ? wp_create_nonce( 'modify-theme-favorite' ) : false,
    138144                ),
    139                 'browseDefault'=> 'popular',
     145                'browseDefault'=> WPORG_THEMES_DEFAULT_BROWSE,
    140146            ),
    141147            'l10n' => array(
Note: See TracChangeset for help on using the changeset viewer.