bb_get_profile_link

The BuddyPress bb get profile link function.

Description

bb_get_profile_link( (string) $args = '' ); 

Parameters (1)

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

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-template.php  
  1. function bb_get_profile_link( $args = '' ) { 
  2. if ( $args && is_string($args) && false === strpos($args, '=') ) 
  3. $args = array( 'text' => $args ); 
  4. elseif ( is_numeric($args) ) 
  5. $args = array( 'id' => $args ); 
  6.  
  7. $defaults = array( 'text' => __('View your profile'), 'before' => '', 'after' => '', 'id' => false ); 
  8. $args = wp_parse_args( $args, $defaults ); 
  9. extract($args, EXTR_SKIP); 
  10.  
  11. $id = (int) $id; 
  12. if ( !$id ) 
  13. $id = bb_get_current_user_info( 'id' ); 
  14.  
  15. return apply_filters( 'bb_get_profile_link', "$before<a href='" . esc_attr( get_user_profile_link( $id ) ) . "'>$text</a>$after", $args );