WordPress.org

Making WordPress.org

Changeset 9867


Ignore:
Timestamp:
05/13/2020 05:12:55 AM (7 months ago)
Author:
dd32
Message:

Login: Remove specific SEO fixes that are included in the generic SEO fixes plugin.

See #5173.

File:
1 edited

Legend:

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

    r9856 r9867  
    190190
    191191// Don't index login/register pages.
    192 add_action( 'wp_head', 'wp_no_robots', 1 );
     192add_filter( 'wporg_noindex_request', '__return_true' );
    193193
    194194// No emoji support needed.
     
    360360
    361361/**
    362  * Add a canonical tag to the login screens.
    363  */
    364 function wporg_login_canonical_link() {
     362 * The canonical url for login.wordpress.org is a bit different.
     363 */
     364function wporg_login_canonical_url( $canonical ) {
    365365    $canonical = false;
    366366
     367    // If the regular expression for this route is not matching, it's the canonical.
    367368    $matching_route = stripos( WP_WPOrg_SSO::$matched_route_regex, '(' );
    368369    if ( false === $matching_route ) {
     
    375376    }
    376377
    377     if ( $canonical ) {
    378         printf( '<link rel="canonical" href="%s" />', esc_url( $canonical ) );
    379     }
    380 }
    381 add_action( 'login_head', 'wporg_login_canonical_link' );
    382 add_action( 'wp_head', 'wporg_login_canonical_link' );
     378    return $canonical;
     379}
     380add_filter( 'wporg_canonical_url', 'wporg_login_canonical_url' );
    383381
    384382/**
Note: See TracChangeset for help on using the changeset viewer.