Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/18/2012 02:56:01 AM (9 years ago)
Author:
jmdodd
Message:

Shortcode iteration for search introduced in #1575.

  • Fix bbp-search shortcode.
  • Introduce bbp-search-form shortcode.
  • Fixes #2107.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/search/template-tags.php

    r4581 r4586  
    9797        if ( $wp_rewrite->using_permalinks() ) {
    9898
    99             // Search
    100             $base = trailingslashit( bbp_get_search_url() ) . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
     99            // Shortcode territory
     100            if ( is_page() || is_single() ) {
     101                $base = trailingslashit( get_permalink() );
     102
     103            // Default search location
     104            } else {
     105                $base = trailingslashit( bbp_get_search_url() );
     106
     107            }
     108
     109            // Add pagination base
     110            $base = $base . user_trailingslashit( $wp_rewrite->pagination_base . '/%#%/' );
    101111
    102112        // Unpretty permalinks
     
    106116
    107117        // Add args
    108         $add_args = array( bbp_get_search_rewrite_id() => urlencode( bbp_get_search_terms() ) );
     118        $add_args = isset( $_GET[bbp_get_search_rewrite_id()] ) ? array( bbp_get_search_rewrite_id() => urlencode( bbp_get_search_terms() ) ) : array();
    109119        if ( bbp_get_view_all() )
    110120            $add_args['view'] = 'all';
Note: See TracChangeset for help on using the changeset viewer.