Changeset 9867
- Timestamp:
- 05/13/2020 05:12:55 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php
r9856 r9867 190 190 191 191 // Don't index login/register pages. 192 add_ action( 'wp_head', 'wp_no_robots', 1);192 add_filter( 'wporg_noindex_request', '__return_true' ); 193 193 194 194 // No emoji support needed. … … 360 360 361 361 /** 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 */ 364 function wporg_login_canonical_url( $canonical ) { 365 365 $canonical = false; 366 366 367 // If the regular expression for this route is not matching, it's the canonical. 367 368 $matching_route = stripos( WP_WPOrg_SSO::$matched_route_regex, '(' ); 368 369 if ( false === $matching_route ) { … … 375 376 } 376 377 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 } 380 add_filter( 'wporg_canonical_url', 'wporg_login_canonical_url' ); 383 381 384 382 /**
Note: See TracChangeset
for help on using the changeset viewer.