bbp_get_page_by_path

Used to guess if page exists at requested path.

Description

bbp_get_page_by_path( (string) $path = '' ); 

Parameters (1)

0. $path — Optional. (string) => ''
The path.

Usage

  1. if ( !function_exists( 'bbp_get_page_by_path' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/functions.php'; 
  3.  
  4. // The path. 
  5. $path = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_page_by_path($path); 
  9.  

Defined (1)

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

/includes/common/functions.php  
  1. function bbp_get_page_by_path( $path = '' ) { 
  2.  
  3. // Default to false 
  4. $retval = false; 
  5.  
  6. // Path is not empty 
  7. if ( !empty( $path ) ) { 
  8.  
  9. // Pretty permalinks are on so path might exist 
  10. if ( get_option( 'permalink_structure' ) ) { 
  11. $retval = get_page_by_path( $path ); 
  12.  
  13. return apply_filters( 'bbp_get_page_by_path', $retval, $path );