Making WordPress.org

Changeset 11494


Ignore:
Timestamp:
01/31/2022 09:45:57 PM (3 years ago)
Author:
iandunn
Message:

Translate: Remove code unused after new header/footer launch.

See https://github.com/WordPress/wporg-mu-plugins/issues/55

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  
    7777            $this->register_cli_commands();
    7878        }
    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' ) );
    8379    }
    8480
     
    561557        return $content;
    562558    }
    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. We
    568      * 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 $stylesheet
    574      *
    575      * @return string
    576      */
    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 variables
    580          * 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     }
    599559}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/footer.php

    r11445 r11494  
    33<?php
    44
    5 if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) {
    6     echo do_blocks( '<!-- wp:wporg/global-footer /-->' );
    7 
    8 } else {
    9     require WPORGPATH . 'footer.php';
    10 }
     5echo do_blocks( '<!-- wp:wporg/global-footer /-->' );
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/header.php

    r11489 r11494  
    11<?php
    22
    3 if ( FEATURE_2021_GLOBAL_HEADER_FOOTER ) {
    4     echo do_blocks( '<!-- wp:wporg/global-header /-->' );
    5 
    6 } else {
    7     require WPORGPATH . 'header.php';
    8 }
     3echo do_blocks( '<!-- wp:wporg/global-header /-->' );
    94
    105?>
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php

    r11463 r11494  
    4949if ( isset( $template ) && 'translations' === $template ) {
    5050    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' );
    5651}
    5752
Note: See TracChangeset for help on using the changeset viewer.