bb_get_uri_page

The BuddyPress bb get uri page function.

Description

bb_get_uri_page(); 

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_get_uri_page() { 
  2. if ( isset($_GET['page']) && is_numeric($_GET['page']) && 1 < (int) $_GET['page'] ) 
  3. return (int) $_GET['page']; 
  4.  
  5. if ( isset($_SERVER['PATH_INFO']) ) 
  6. $path = $_SERVER['PATH_INFO']; 
  7. else 
  8. if ( !$path = strtok($_SERVER['REQUEST_URI'], '?') ) 
  9. return 1; 
  10.  
  11. if ( preg_match( '/^\/([0-9]+)\/?$/', $path, $matches ) ) { 
  12. $page = (int) $matches[1]; 
  13. if ( 1 < $page ) { 
  14. return $page; 
  15.  
  16. if ( $page = strstr($path, '/page/') ) { 
  17. $page = (int) substr($page, 6); 
  18. if ( 1 < $page ) 
  19. return $page; 
  20. return 1;