Theme: Enable testing new header on w.org sandboxes

See https://github.com/WordPress/wporg-mu-plugins/issues/19
This commit is contained in:
Ian Dunn 2021-12-22 09:09:58 -08:00
parent e49ee6bf94
commit ac25f4c008
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
3 changed files with 24 additions and 9 deletions

View file

@ -6,4 +6,10 @@ namespace WordPressDotOrg\FiveForTheFuture\Theme;
</div><!-- #content -->
<?php require WPORGPATH . 'footer.php';
<?php
if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) {
echo do_blocks( '<!-- wp:wporg/global-footer /-->' );
} else {
require WPORGPATH . 'footer.php';
}

View file

@ -2,6 +2,11 @@
namespace WordPressDotOrg\FiveForTheFuture\Theme;
// Temporary for local environments. Remove this when the new header launches.
// See https://github.com/WordPress/wporg-mu-plugins/issues/38
if ( ! defined( 'FEATURE_2021_GLOBAL_HEADER_FOOTER' ) ) {
define( 'FEATURE_2021_GLOBAL_HEADER_FOOTER', false );
}
/**
* Sets up theme defaults and registers support for various WordPress features.

View file

@ -2,17 +2,21 @@
namespace WordPressDotOrg\FiveForTheFuture\Theme;
global $wporg_global_header_options;
$GLOBALS['pagetitle'] = wp_get_document_title();
if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) {
echo do_blocks( '<!-- wp:wporg/global-header /-->' );
} else {
global $wporg_global_header_options;
$GLOBALS['pagetitle'] = wp_get_document_title();
if ( ! isset( $wporg_global_header_options['in_wrapper'] ) ) {
$wporg_global_header_options['in_wrapper'] = '';
if ( ! isset( $wporg_global_header_options['in_wrapper'] ) ) {
$wporg_global_header_options['in_wrapper'] = '';
}
$wporg_global_header_options['in_wrapper'] .= '<a class="skip-link screen-reader-text" href="#main">' . esc_html__( 'Skip to content', 'wporg-5ftf' ) . '</a>';
require WPORGPATH . 'header.php';
}
$wporg_global_header_options['in_wrapper'] .= '<a class="skip-link screen-reader-text" href="#main">' . esc_html__( 'Skip to content', 'wporg-5ftf' ) . '</a>';
require WPORGPATH . 'header.php';
?>
<div id="page" class="site">