WordPress.org

Making WordPress.org

Changeset 9597


Ignore:
Timestamp:
03/17/2020 08:31:01 PM (9 months ago)
Author:
coffee2code
Message:

Support theme: Default front page search form to search "Support Docs" documentation instead of forums.

Otherwise, there is no direct method for searching the documentation (prior to reaching the Google search results page). Forums-specific search can still be done via the forums.

See [15846-dotorg].
Fixes #4358.

File:
1 edited

Legend:

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

    r5163 r9597  
    1717    <label for="s" class="screen-reader-text"><?php _ex( 'Search for:', 'label', 'wporg-forums' ); ?></label>
    1818    <?php
     19        $tab = null;
    1920        if ( 'wporg_compat_before_single_view' === current_action() ) {
    2021            $placeholder = _x( 'Search this forum', 'placeholder', 'wporg-forums' );
    2122            $project     = wporg_support_get_compat_object();
     23        } elseif ( is_front_page() ) {
     24            $placeholder = _x( 'Search documentation', 'placeholder', 'wporg-forums' );
     25            $project     = null;
     26            $tab         = 'docs';
    2227        } else {
    2328            $placeholder = _x( 'Search forums', 'placeholder', 'wporg-forums' );
     
    2934    <input type="hidden" name="intext" value="<?php echo esc_attr( $project->prefixed_title ); ?>" />
    3035    <?php endif; ?>
     36    <?php if ( $tab ) : ?>
     37    <input type="hidden" name="tab" value="<?php echo esc_attr( $tab ); ?>" />
     38    <?php endif; ?>
    3139    <button class="button button-primary button-search"><i class="dashicons dashicons-search"></i><span class="screen-reader-text"><?php _e( 'Search forums', 'wporg-forums' ); ?></span></button>
    3240</form>
Note: See TracChangeset for help on using the changeset viewer.