Making WordPress.org


Ignore:
Timestamp:
01/17/2022 04:45:59 AM (5 years ago)
Author:
dd32
Message:

Themes: Use a mu-plugin to output consistent skip-to links for all themes.

This is to remove the reliance upon $wporg_global_header_options.

See ​https://github.com/WordPress/wporg-mu-plugins/issues/42, ​https://github.com/WordPress/wporg-mu-plugins/pull/70.
Closes ​https://github.com/WordPress/wordpress.org/pull/49

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-learn-2020/header.php

    r11413 r11448  
    1414use function WPOrg_Learn\Locale\{ locale_notice };
    1515
     16\WordPressdotorg\skip_to( '#main' );
     17
    1618if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) {
    1719        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    1820        echo do_blocks( '<!-- wp:wporg/global-header /-->' );
    1921} else {
    20         global $wporg_global_header_options;
    21         if ( ! isset( $wporg_global_header_options['in_wrapper'] ) ) {
    22                 $wporg_global_header_options['in_wrapper'] = '';
    23         }
    24         $wporg_global_header_options['in_wrapper'] .= '<a class="skip-link screen-reader-text" href="#content">' . esc_html__( 'Skip to content', 'wporg-learn' ) . '</a>';
    2522        wporg_get_global_header();
    2623}
    … …  
    3734
    3835<div id="page" class="site">
    39         <a class="skip-link screen-reader-text" href="#main"><?php esc_html_e( 'Skip to content', 'wporg-learn' ); ?></a>
    40 
    4136        <div id="content">
    4237                <header id="masthead" class="site-header <?php echo is_front_page() ? 'home' : ''; ?>" role="banner">
Note: See TracChangeset for help on using the changeset viewer.