Changeset 11494 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/inc/class-plugin.php
- Timestamp:
- 01/31/2022 09:45:57 PM (5 years ago)
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.