bb_find_filename

The BuddyPress bb find filename function.

Description

bb_find_filename( $text ); 

Parameters (1)

0. $text
The text.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_find_filename( $text ) { 
  2. if ( preg_match('|.*?/([a-z\-]+\.php)/?.*|', $text, $matches) ) 
  3. return $matches[1]; 
  4. else { 
  5. $path = bb_get_option( 'path' ); 
  6. $text = preg_replace("#^$path#", '', $text); 
  7. $text = preg_replace('#/.+$#', '', $text); 
  8. return $text . '.php'; 
  9. return false;