Skip to:
Content

BuddyPress.org

Changeset 3068


Ignore:
Timestamp:
06/26/2010 11:30:43 PM (16 years ago)
Author:
johnjamesjacoby
Message:

Fixes #1956

Location:
branches/1.2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2/bp-core/bp-core-templatetags.php

    r3049 r3068  
    995995        }
    996996
     997/**
     998 * bp_search_form_available()
     999 *
     1000 * Only show the search form if there are available objects to search for.
     1001 *
     1002 * @global array $bp
     1003 * @uses function_exists
     1004 * @uses bp_core_is_multisite()
     1005 * @return bool Filterable result
     1006 */
     1007function bp_search_form_enabled() {
     1008        global $bp;
     1009
     1010        if ( function_exists( 'xprofile_install' )
     1011                 || function_exists( 'groups_install' )
     1012                 || ( function_exists( 'bp_blogs_install' ) && bp_core_is_multisite() )
     1013                 || ( function_exists( 'bp_forums_setup' ) && !(int)$bp->site_options['bp-disable-forum-directory'] )
     1014                ) {
     1015                $search_enabled = true;
     1016        } else {
     1017                $search_enabled = false;
     1018        }
     1019
     1020        return apply_filters( 'bp_search_form_enabled', $search_enabled );
     1021}
     1022
    9971023function bp_search_form_action() {
    9981024        global $bp;
  • branches/1.2/bp-themes/bp-default/header.php

    r2785 r3068  
    8585                                <div class="padder">
    8686
    87                                 <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
    88                                         <input type="text" id="search-terms" name="search-terms" value="" />
    89                                         <?php echo bp_search_form_type_select() ?>
     87                                <?php if ( bp_search_form_enabled() ) : ?>
    9088
    91                                         <input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
    92                                         <?php wp_nonce_field( 'bp_search_form' ) ?>
    93                                 </form><!-- #search-form -->
     89                                        <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
     90                                                <input type="text" id="search-terms" name="search-terms" value="" />
     91                                                <?php echo bp_search_form_type_select() ?>
     92
     93                                                <input type="submit" name="search-submit" id="search-submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
     94                                                <?php wp_nonce_field( 'bp_search_form' ) ?>
     95                                        </form><!-- #search-form -->
     96
     97                                <?php endif; ?>
    9498
    9599                                <?php do_action( 'bp_search_login_bar' ) ?>
Note: See TracChangeset for help on using the changeset viewer.