[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Source view] [Print] [Project Stats]
Author Template functions for use in themes. These functions must be used within the WordPress Loop.
File Size: | 630 lines (19 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
get_the_author( $deprecated = '' ) X-Ref |
Retrieves the author of the current post. param: string $deprecated Deprecated. return: string The author's display name, empty string if unknown. |
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. param: string $deprecated Deprecated. param: bool $deprecated_echo Deprecated. Use get_the_author(). Echo the string or return it. return: string The author's display name, from get_the_author(). |
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. |
the_modified_author() X-Ref |
Displays the name of the author who last edited the current post, if the author's ID is available. |
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 param: string $field Optional. The user field to retrieve. Default empty. param: int|false $user_id Optional. User ID. Defaults to the current post author. return: string The author's field from the current author's DB object, otherwise an empty string. |
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. Defaults to the current post author. |
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 An HTML link if the author's URL exists in user meta, |
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. |
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. |
the_author_posts() X-Ref |
Displays the number of posts by the author of the current post. |
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 is not set. |
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. |
get_author_posts_url( $author_id, $author_nicename = '' ) X-Ref |
Retrieves the URL to the author page for the user with the ID provided. param: int $author_id Author ID. param: string $author_nicename Optional. The author's nicename (slug). Default empty. return: string The URL to the author's page. |
wp_list_authors( $args = '' ) X-Ref |
Lists all the authors of the site, with several options available. param: string|array $args { return: void|string Void if 'echo' argument is true, list of authors if 'echo' is false. |
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 |
__clear_multi_author_cache() X-Ref |
Helper function to clear the cache for number of authors. |
Generated : Thu Nov 21 08:20:01 2024 | Cross-referenced by PHPXref |