bp_get_requested_url

Return the URL as requested on the current page load by the user agent.

Description

(string) bp_get_requested_url(); 

Returns (string)

Requested URL string.


Usage

  1. if ( !function_exists( 'bp_get_requested_url' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-catchuri.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_get_requested_url(); 
  7.  

Defined (1)

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

/bp-core/bp-core-catchuri.php  
  1. function bp_get_requested_url() { 
  2. $bp =buddypress); 
  3.  
  4. if ( empty( $bp->canonical_stack['requested_url'] ) ) { 
  5. $bp->canonical_stack['requested_url'] = is_ssl() ? 'https://' : 'http://'; 
  6. $bp->canonical_stack['requested_url'] .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 
  7.  
  8. /** 
  9. * Filters the URL as requested on the current page load by the user agent. 
  10. * @since 1.7.0 
  11. * @param string $value Requested URL string. 
  12. */ 
  13. return apply_filters( 'bp_get_requested_url', $bp->canonical_stack['requested_url'] );