Skip to:
Content

BuddyPress.org

Changeset 4532


Ignore:
Timestamp:
06/19/2011 02:50:06 PM (14 years ago)
Author:
djpaul
Message:

Deprecate bp_search_form_enabled() as it's not required; you'll always be able to search posts.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template.php

    r4506 r4532  
    295295
    296296/** Search Form ***************************************************************/
    297 
    298 /**
    299  * bp_search_form_available()
    300  *
    301  * Only show the search form if there are available objects to search for.
    302  *
    303  * @uses function_exists
    304  * @uses is_multisite()
    305  * @return bool Filterable result
    306  */
    307 function bp_search_form_enabled() {
    308     if ( bp_is_active( 'xprofile' )
    309          || bp_is_active( 'groups' )
    310          || ( bp_is_active( 'blogs' ) && is_multisite() )
    311          || ( bp_is_active( 'forums' ) && !bp_forum_directory_is_disabled() )
    312     ) {
    313         $search_enabled = true;
    314     } else {
    315         $search_enabled = false;
    316     }
    317 
    318     return apply_filters( 'bp_search_form_enabled', $search_enabled );
    319 }
    320297
    321298function bp_search_form_action() {
  • trunk/bp-core/deprecated/1.3.php

    r4309 r4532  
    370370    _deprecated_function( __FUNCTION__, '1.3', 'bp_loggedin_user_link' );
    371371    bp_loggedin_user_link();
     372}
     373
     374/**
     375 * Only show the search form if there are available objects to search for.
     376 * Deprecated in 1.3; not used anymore.
     377 *
     378 * @return bool
     379 */
     380function bp_search_form_enabled() {
     381    _deprecated_function( __FUNCTION__, '1.3', 'No longer required.' );
     382    return apply_filters( 'bp_search_form_enabled', true );
    372383}
    373384
  • trunk/bp-themes/bp-default/header.php

    r4455 r4532  
    2828                    <h1 id="logo" role="banner"><a href="<?php echo home_url(); ?>" title="<?php echo _x( 'Home', 'Home page banner link title', 'buddypress' ); ?>"><?php bp_site_name(); ?></a></h1>
    2929
    30                     <?php if ( bp_search_form_enabled() ) : ?>
    31 
    3230                        <form action="<?php echo bp_search_form_action() ?>" method="post" id="search-form">
    3331                            <label for="search-terms" class="accessibly-hidden"><?php _e( 'Search for:', 'buddypress' ); ?></label>
     
    4139
    4240                        </form><!-- #search-form -->
    43 
    44                     <?php endif; ?>
    4541
    4642                <?php do_action( 'bp_search_login_bar' ) ?>
Note: See TracChangeset for help on using the changeset viewer.