bb_trim_common_path_right

The BuddyPress bb trim common path right function.

Description

bb_trim_common_path_right( $one, $two ); 

Parameters (2)

0. $one
The one.
1. $two
The two.

Usage

  1. if ( !function_exists( 'bb_trim_common_path_right' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-deprecated.php'; 
  3.  
  4. // The one. 
  5. $one = null; 
  6.  
  7. // The two. 
  8. $two = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_trim_common_path_right($one, $two); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-deprecated.php  
  1. function bb_trim_common_path_right( $one, $two ) { 
  2. bb_log_deprecated('function', __FUNCTION__, 'no alternative'); 
  3. $root_one = false; 
  4. $root_two = false; 
  5.  
  6. while ( false === $root_one ) { 
  7. $base_one = basename($one); 
  8. $base_two = basename($two); 
  9. if ( !$base_one || !$base_two ) 
  10. break;  
  11. if ( $base_one == $base_two ) { 
  12. $one = dirname($one); 
  13. $two = dirname($two); 
  14. } else { 
  15. $root_one = $one; 
  16. $root_two = $two; 
  17.  
  18. return array($root_one, $root_two);