bbp_get_search_url

Return the search url.

Description

(string) bbp_get_search_url(); 

Returns (string)

Search url


Usage

  1. if ( !function_exists( 'bbp_get_search_url' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/search/template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_get_search_url(); 
  7.  

Defined (1)

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

/includes/search/template.php  
  1. function bbp_get_search_url() { 
  2. global $wp_rewrite; 
  3.  
  4. // Pretty permalinks 
  5. if ( $wp_rewrite->using_permalinks() ) { 
  6. $url = $wp_rewrite->root . bbp_get_search_slug(); 
  7. $url = home_url( user_trailingslashit( $url ) ); 
  8.  
  9. // Unpretty permalinks 
  10. } else { 
  11. $url = add_query_arg( array( bbp_get_search_rewrite_id() => '' ), home_url( '/' ) ); 
  12.  
  13. return apply_filters( 'bbp_get_search_url', $url );