Changeset 11494
- Timestamp:
- 01/31/2022 09:45:57 PM (3 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
r11456 r11494 77 77 $this->register_cli_commands(); 78 78 } 79 80 // @todo temporary for new header/footer launch.81 add_filter( 'stylesheet', array( $this, 'switch_theme_for_new_header' ) );82 add_filter( 'template', array( $this, 'switch_theme_for_new_header' ) );83 79 } 84 80 … … 561 557 return $content; 562 558 } 563 564 /**565 * Switch to the `wporg-main` theme once the new header/footer launches.566 *567 * TwentyFifteen has a bunch of styles that interfere with the design, and we don't want them enqueued. We568 * do want to enqueue all the other styles/scripts from Core/plugins, though.569 * See `blocks/global-header-footer/classic-header.php`.570 *571 * @todo This can be removed after launch, but you must permanently switch the theme to `pub/wporg-main`.572 *573 * @param string $stylesheet574 *575 * @return string576 */577 function switch_theme_for_new_header( $stylesheet ) {578 /*579 * Otherwise this interferes with `render_global_styles()`, and we don't get all of the CSS variables580 * from News.581 */582 if ( ms_is_switched() ) {583 return $stylesheet;584 }585 586 if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) {587 if ( 'stylesheet' === current_filter() ) {588 $stylesheet = 'pub/wporg-main';589 } else {590 /* template */591 $stylesheet = 'pub/wporg';592 }593 } else {594 $stylesheet = 'core/twentyfifteen';595 }596 597 return $stylesheet;598 }599 559 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/footer.php
r11445 r11494 3 3 <?php 4 4 5 if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) { 6 echo do_blocks( '<!-- wp:wporg/global-footer /-->' ); 7 8 } else { 9 require WPORGPATH . 'footer.php'; 10 } 5 echo do_blocks( '<!-- wp:wporg/global-footer /-->' ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/header.php
r11489 r11494 1 1 <?php 2 2 3 if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) { 4 echo do_blocks( '<!-- wp:wporg/global-header /-->' ); 5 6 } else { 7 require WPORGPATH . 'header.php'; 8 } 3 echo do_blocks( '<!-- wp:wporg/global-header /-->' ); 9 4 10 5 ?> -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php
r11463 r11494 49 49 if ( isset( $template ) && 'translations' === $template ) { 50 50 gp_enqueue_script( 'wporg-translate-editor' ); 51 }52 53 // The new header calls wp_head + gp_head, the old header only calls one or the other, so we must manually add this.54 if ( ! FEATURE_2021_GLOBAL_HEADER_FOOTER ) {55 add_action( 'gp_head', '_wp_render_title_tag' );56 51 } 57 52
Note: See TracChangeset
for help on using the changeset viewer.