get_author_link

Returns or Prints link to the author's posts.

Description

(string|null) get_author_link( (bool) $echo, (int) $author_id, (string) $author_nicename = '' ); 

Returns (string|null)

Parameters (3)

0. $echo (bool)
The echo.
1. $author_id (int)
The author id.
2. $author_nicename — Optional. (string) => ''
The author nicename.

Usage

  1. if ( !function_exists( 'get_author_link' ) ) { 
  2. require_once ABSPATH . WPINC . '/deprecated.php'; 
  3.  
  4. // The echo. 
  5. $echo = true; 
  6.  
  7. // The author id. 
  8. $author_id = -1; 
  9.  
  10. // The author nicename. 
  11. $author_nicename = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = get_author_link($echo, $author_id, $author_nicename); 
  15.  

Defined (1)

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

/wp-includes/deprecated.php  
  1. function get_author_link($echo, $author_id, $author_nicename = '') { 
  2. _deprecated_function( __FUNCTION__, '2.1.0', 'get_author_posts_url()' ); 
  3.  
  4. $link = get_author_posts_url($author_id, $author_nicename); 
  5.  
  6. if ( $echo ) 
  7. echo $link; 
  8. return $link;