Changeset 9829 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php
- Timestamp:
- 05/07/2020 12:52:06 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php
r9462 r9829 362 362 $canonical = false; 363 363 364 // If the regular expression for this route is not matching, it's the canonical. 365 if ( false === stripos( WP_WPOrg_SSO::$matched_route_regex, '(' ) ) { 366 $canonical = site_url( WP_WPOrg_SSO::$matched_route_regex ?: '/' ); 364 $matching_route = stripos( WP_WPOrg_SSO::$matched_route_regex, '(' ); 365 if ( false === $matching_route ) { 366 $canonical = home_url( WP_WPOrg_SSO::$matched_route_regex ?: '/' ); 367 368 // Else, if there's a long enough slug followed by a `/`, that's a parent page. 369 } elseif ( $matching_route >= 3 && '/' === substr( WP_WPOrg_SSO::$matched_route_regex, $matching_route + 1, 1 ) ) { 370 $canonical = home_url( substr( WP_WPOrg_SSO::$matched_route_regex, 0, $matching_route ) ); 371 367 372 } 368 373 … … 373 378 add_action( 'login_head', 'wporg_login_canonical_link' ); 374 379 add_action( 'wp_head', 'wporg_login_canonical_link' ); 380 381 /** 382 * Set the title for the wp-login.php page. 383 */ 384 function wporg_login_title() { 385 return get_bloginfo( 'name', 'display' ); 386 } 387 add_filter( 'login_title', 'wporg_login_title' );
Note: See TracChangeset
for help on using the changeset viewer.