Making WordPress.org

Changeset 11026


Ignore:
Timestamp:
06/11/2021 05:48:08 AM (3 years ago)
Author:
dd32
Message:

Search: Ensure that all appropriate variables are predefined to cover all cases.

Follow up to [11025].
See #5771.

File:
1 edited

Legend:

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

    r11025 r11026  
    1717    <label for="s" class="screen-reader-text"><?php _ex( 'Search for:', 'label', 'wporg-forums' ); ?></label>
    1818    <?php
    19         $tab = null;
     19        $placeholder = _x( 'Search forums', 'placeholder', 'wporg-forums' );
     20        $project     = false;
     21        $tab         = 'support';
     22
    2023        if ( in_array( current_action(), [ 'bbp_template_before_pagination_loop', 'wporg_compat_before_single_view' ] ) ) {
    2124            $placeholder = _x( 'Search this forum', 'placeholder', 'wporg-forums' );
     
    2528        } elseif ( is_front_page() ) {
    2629            $placeholder = _x( 'Search documentation', 'placeholder', 'wporg-forums' );
    27             $project     = null;
    2830            $tab         = 'docs';
    2931        } elseif ( is_search() || bbp_is_search() ) {
    30             if ( isset( $_GET['tab'] ) ) {
     32            if ( !empty( $_GET['tab'] ) ) {
    3133                $tab     = $_GET['tab'];
    3234                $project = $_GET[ $_GET['tab'] ];
    3335            }
    34         } else {
    35             $placeholder = _x( 'Search forums', 'placeholder', 'wporg-forums' );
    36             $project     = null;
    37             $tab         = 'support';
    3836        }
    3937    ?>
Note: See TracChangeset for help on using the changeset viewer.