bp_get_search_input_name

Get the 'name' attribute for the search form input element.

Description

(string) bp_get_search_input_name( (string) $component = '' ); 

Returns (string)

Text for the 'name' attribute.

Parameters (1)

0. $component — Optional. (string) => ''
Component name. Defaults to current component.

Usage

  1. if ( !function_exists( 'bp_get_search_input_name' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-template.php'; 
  3.  
  4. // Component name. Defaults to current component. 
  5. $component = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bp_get_search_input_name($component); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-core/bp-core-template.php  
  1. function bp_get_search_input_name( $component = '' ) { 
  2. if ( ! $component ) { 
  3. $component = bp_current_component(); 
  4.  
  5. $bp =buddypress); 
  6.  
  7. $name = ''; 
  8. if ( isset( $bp->{$component}->id ) ) { 
  9. $name = $bp->{$component}->id . '_search'; 
  10.  
  11. return $name;