[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-includes/ -> author-template.php (summary)

Author Template functions for use in themes. These functions must be used within the WordPress Loop.

File Size: 591 lines (18 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 16 functions

  get_the_author()
  the_author()
  get_the_modified_author()
  the_modified_author()
  get_the_author_meta()
  the_author_meta()
  get_the_author_link()
  the_author_link()
  get_the_author_posts()
  the_author_posts()
  get_the_author_posts_link()
  the_author_posts_link()
  get_author_posts_url()
  wp_list_authors()
  is_multi_author()
  __clear_multi_author_cache()

Functions
Functions that are not part of a class:

get_the_author( $deprecated = '' )   X-Ref
Retrieves the author of the current post.

return: string|null The author's display name.
param: string $deprecated Deprecated.
since: 1.5.0

the_author( $deprecated = '', $deprecated_echo = true )   X-Ref
Displays the name of the author of the current post.

The behavior of this function is based off of old functionality predating
get_the_author(). This function is not deprecated, but is designed to echo
the value from get_the_author() and as an result of any old theme that might
still use the old behavior will also pass the value from get_the_author().

The normal, expected behavior of this function is to echo the author and not
return it. However, backward compatibility has to be maintained.

return: string|null The author's display name, from get_the_author().
param: string $deprecated      Deprecated.
param: bool   $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it.
since: 0.71

get_the_modified_author()   X-Ref
Retrieves the author who last edited the current post.

return: string|void The author's display name, empty string if unknown.
since: 2.8.0

the_modified_author()   X-Ref
Displays the name of the author who last edited the current post,
if the author's ID is available.

since: 2.8.0

get_the_author_meta( $field = '', $user_id = false )   X-Ref
Retrieves the requested data of the author of the current post.

Valid values for the `$field` parameter include:

- admin_color
- aim
- comment_shortcuts
- description
- display_name
- first_name
- ID
- jabber
- last_name
- nickname
- plugins_last_view
- plugins_per_page
- rich_editing
- syntax_highlighting
- user_activation_key
- user_description
- user_email
- user_firstname
- user_lastname
- user_level
- user_login
- user_nicename
- user_pass
- user_registered
- user_status
- user_url
- yim

return: string The author's field from the current author's DB object, otherwise an empty string.
param: string    $field   Optional. The user field to retrieve. Default empty.
param: int|false $user_id Optional. User ID.
since: 2.8.0

the_author_meta( $field = '', $user_id = false )   X-Ref
Outputs the field from the user's DB object. Defaults to current post's author.

param: string    $field   Selects the field of the users record. See get_the_author_meta()
param: int|false $user_id Optional. User ID.
since: 2.8.0

get_the_author_link()   X-Ref
Retrieves either author's link or author's name.

If the author has a home page set, return an HTML link, otherwise just return the
author's name.

return: string|null An HTML link if the author's url exist in user meta,
since: 3.0.0

the_author_link()   X-Ref
Displays either author's link or author's name.

If the author has a home page set, echo an HTML link, otherwise just echo the
author's name.

since: 2.1.0

get_the_author_posts()   X-Ref
Retrieves the number of posts by the author of the current post.

return: int The number of posts by the author.
since: 1.5.0

the_author_posts()   X-Ref
Displays the number of posts by the author of the current post.

since: 0.71

get_the_author_posts_link()   X-Ref
Retrieves an HTML link to the author page of the current post's author.

Returns an HTML-formatted link using get_author_posts_url().

return: string An HTML link to the author page, or an empty string if $authordata isn't defined.
since: 4.4.0

the_author_posts_link( $deprecated = '' )   X-Ref
Displays an HTML link to the author page of the current post's author.

param: string $deprecated Unused.
since: 1.2.0
since: 4.4.0 Converted into a wrapper for get_the_author_posts_link()

get_author_posts_url( $author_id, $author_nicename = '' )   X-Ref
Retrieves the URL to the author page for the user with the ID provided.

return: string The URL to the author's page.
param: int    $author_id       Author ID.
param: string $author_nicename Optional. The author's nicename (slug). Default empty.
since: 2.1.0

wp_list_authors( $args = '' )   X-Ref
Lists all the authors of the site, with several options available.

return: void|string Void if 'echo' argument is true, list of authors if 'echo' is false.
param: string|array $args {
since: 1.2.0

is_multi_author()   X-Ref
Determines whether this site has more than one author.

Checks to see if more than one author has published posts.

For more information on this and similar theme functions, check out
the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
Conditional Tags} article in the Theme Developer Handbook.

return: bool Whether or not we have more than one author
since: 3.2.0

__clear_multi_author_cache()   X-Ref
Helper function to clear the cache for number of authors.

since: 3.2.0



Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1