Making WordPress.org


Ignore:
Timestamp:
09/05/2022 05:14:31 AM (3 years ago)
Author:
dufresnesteven
Message:

wporg-developer: Sync with https://github.com/WordPress/wporg-developer/commit/790d402933d2725374de0d19e6bf6a576c8b15d2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/header.php

    r11496 r12050  
    88 */
    99
     10\WordPressdotorg\skip_to( '#content' );
     11
    1012echo do_blocks( '<!-- wp:wporg/global-header /-->' );
     13
     14$show_search = DevHub\should_show_search_bar();
     15
     16// When to show the masthead
     17$show_masthead = is_front_page() || is_page( 'reference' );
    1118
    1219?>
    1320
    14 <header id="masthead" class="site-header<?php if ( is_front_page() ) { echo ' home'; } ?>" role="banner">
     21<header id="masthead" class="site-header<?php if ( $show_masthead ) { echo ' home'; } ?>" role="banner">
    1522    <?php if ( function_exists( 'wporg_is_handbook' ) && wporg_is_handbook() && ! is_search() ) : ?>
    1623        <a href="#" id="secondary-toggle" onclick="return false;"><strong><?php _e( 'Menu', 'wporg' ); ?></strong></a>
    1724    <?php endif; ?>
    18     <div class="site-branding">
     25    <div class="site-branding<?php echo ! $show_masthead && $show_search ? ' has-actions': '' ?>">
     26
    1927        <h1 class="site-title">
    2028            <a href="<?php echo esc_url( DevHub\get_site_section_url() ); ?>" rel="home"><?php echo DevHub\get_site_section_title(); ?></a>
     
    2533        <?php endif; ?>
    2634
    27         <nav id="site-navigation" class="main-navigation" role="navigation">
    28             <button class="menu-toggle dashicons dashicons-arrow-down-alt2" aria-controls="primary-menu" aria-expanded="false" aria-label="<?php esc_attr_e( 'Primary Menu', 'wporg' ); ?>"></button>
    29             <?php
    30             $active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu';
    31             wp_nav_menu( array(
    32                 'theme_location'  => $active_menu,
    33                 'container_class' => 'menu-container',
    34                 'container_id'    => 'primary-menu',
    35             ) ); ?>
    36         </nav>
     35        <div>
     36            <?php if ( $show_search ) : ?>
     37                <?php get_search_form(); ?>
     38            <?php endif; ?>
     39
     40            <?php if ( ! $show_masthead ) : ?>
     41            <nav id="site-navigation" class="main-navigation" role="navigation">
     42                <button class="menu-toggle dashicons dashicons-arrow-down-alt2" aria-controls="primary-menu" aria-expanded="false" aria-label="<?php esc_attr_e( 'Primary Menu', 'wporg' ); ?>"></button>
     43                <?php
     44                $active_menu = is_post_type_archive( 'command' ) || is_singular( 'command' ) ? 'devhub-cli-menu' : 'devhub-menu';
     45                wp_nav_menu( array(
     46                    'theme_location'  => $active_menu,
     47                    'container_class' => 'menu-container',
     48                    'container_id'    => 'primary-menu',
     49                ) ); ?>
     50            </nav>
     51            <?php endif; ?>
     52        </div>
    3753    </div>
    3854</header><!-- #masthead -->
    3955
    4056<div id="page" class="hfeed site devhub-wrap">
    41     <a href="#main" class="screen-reader-text"><?php _e( 'Skip to content', 'wporg' ); ?></a>
    42 
    4357    <?php do_action( 'before' ); ?>
    44     <?php
    45     if ( DevHub\should_show_search_bar() ) : ?>
    46         <div id="inner-search">
    47             <?php get_search_form(); ?>
    48             <div id="inner-search-icon-container">
    49                 <div id="inner-search-icon">
    50                     <div class="dashicons dashicons-search"><span class="screen-reader-text"><?php _e( 'Search', 'wporg' ); ?></span></div>
    51                 </div>
    52             </div>
    53         </div>
    54 
    55     <?php endif; ?>
    5658    <div id="content" class="site-content">
Note: See TracChangeset for help on using the changeset viewer.