bbp_get_author_url

Return the author url of a topic or reply.

Description

(string) bbp_get_author_url( (int) $post_id = 0 ); 

Convenience function to ensure proper template functions are called and correct filters are executed. Used primarily to display topic and reply author information in the anonymous user form template-part.

Returns (string)

The url of the author

Parameters (1)

0. $post_id — Optional. (int)
The post id.

Usage

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

Defined (1)

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

/includes/users/template.php  
  1. function bbp_get_author_url( $post_id = 0 ) { 
  2.  
  3. // Define local variable(s) 
  4. $retval = ''; 
  5.  
  6. // Topic edit 
  7. if ( bbp_is_topic_edit() ) { 
  8. $retval = bbp_get_topic_author_url( $post_id ); 
  9.  
  10. // Reply edit 
  11. } elseif ( bbp_is_reply_edit() ) { 
  12. $retval = bbp_get_reply_author_url( $post_id ); 
  13.  
  14. // Not an edit, so rely on current user cookie data 
  15. } else { 
  16. $retval = bbp_current_anonymous_user_data( 'url' ); 
  17.  
  18. return apply_filters( 'bbp_get_author_url', $retval, $post_id );