diff --git a/themes/wporg-5ftf/footer.php b/themes/wporg-5ftf/footer.php index f50caea..dec6ba4 100644 --- a/themes/wporg-5ftf/footer.php +++ b/themes/wporg-5ftf/footer.php @@ -6,4 +6,10 @@ namespace WordPressDotOrg\FiveForTheFuture\Theme; -' ); +} else { + require WPORGPATH . 'footer.php'; +} diff --git a/themes/wporg-5ftf/functions.php b/themes/wporg-5ftf/functions.php index 76fd286..c2112fc 100644 --- a/themes/wporg-5ftf/functions.php +++ b/themes/wporg-5ftf/functions.php @@ -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. diff --git a/themes/wporg-5ftf/header.php b/themes/wporg-5ftf/header.php index a7c7e67..6a7b760 100644 --- a/themes/wporg-5ftf/header.php +++ b/themes/wporg-5ftf/header.php @@ -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( '' ); +} 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'] .= ''; + + require WPORGPATH . 'header.php'; } -$wporg_global_header_options['in_wrapper'] .= ''; - -require WPORGPATH . 'header.php'; - ?>