bbp_get_user_profile_edit_link

Return link to the profile edit page of a user.

Description

(string) bbp_get_user_profile_edit_link( (int) $user_id = 0 ); 

Returns (string)

User profile edit link

Parameters (1)

0. $user_id — Optional. (int)
User id

Usage

  1. if ( !function_exists( 'bbp_get_user_profile_edit_link' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/users/template.php'; 
  3.  
  4. // Optional. User id 
  5. $user_id = -1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bbp_get_user_profile_edit_link($user_id); 
  9.  

Defined (1)

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

/includes/users/template.php  
  1. function bbp_get_user_profile_edit_link( $user_id = 0 ) { 
  2.  
  3. // Validate user id 
  4. $user_id = bbp_get_user_id( $user_id ); 
  5. if ( empty( $user_id ) ) 
  6. return false; 
  7.  
  8. $user = get_userdata( $user_id ); 
  9. $edit_link = '<a href="' . esc_url( bbp_get_user_profile_url( $user_id ) ) . '">' . esc_html( $user->display_name ) . '</a>'; 
  10. return apply_filters( 'bbp_get_user_profile_edit_link', $edit_link, $user_id );