Making WordPress.org

Changeset 5162


Ignore:
Timestamp:
03/22/2017 07:23:29 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Support Forums: Add a search form to plugin- and theme-specific views.

Add support for intext parameter in the search query passed to Google.

See #7.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php

    r5154 r5162  
    278278
    279279            // Add plugin- and theme-specific filters and actions.
    280             add_action( 'wporg_compat_view_sidebar', array( $this, 'do_view_sidebar' ) );
     280            add_action( 'wporg_compat_view_sidebar',       array( $this, 'do_view_sidebar' ) );
    281281            add_action( 'wporg_compat_before_single_view', array( $this, 'do_view_header' ) );
    282282            add_action( 'wporg_compat_before_single_view', array( $this, 'do_subscription_link' ), 11 );
     283            add_action( 'wporg_compat_before_single_view', array( $this, 'do_search_form' ), 11 );
    283284
    284285            // Add output filters and actions.
     
    706707
    707708    /**
     709     * Display a project-specific search form in compat views.
     710     */
     711    function do_search_form() {
     712        get_search_form();
     713    }
     714
     715    /**
    708716     * Term subscriptions use `get_term_link` for the redirect. This needs to be
    709717     * filtered to redirect to the appropriate theme/plugin support view.
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-performance-optimizations.php

    r5075 r5162  
    8585        } elseif ( $is_wp_search ) {
    8686            $search_terms = get_search_query( false );
     87        }
     88
     89        if ( isset( $_GET['intext'] ) ) {
     90            $search_terms .= ' intext:"' . esc_attr( $_GET['intext'] ) . '"';
    8791        }
    8892
Note: See TracChangeset for help on using the changeset viewer.