wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
get_the_author_link › WordPress Function
Depuis3.0.0
Dépréciéen/a
› get_the_author_link ( Pas de paramètres )
Retourne: |
|
Défini(e) dans: |
|
Codex: |
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.Fonctions en relation: get_the_author_login, get_the_author_id, the_author_link, get_author_link, get_the_author_yim
Source
function get_the_author_link() { if ( get_the_author_meta( 'url' ) ) { global $authordata; $author_url = get_the_author_meta( 'url' ); $author_display_name = get_the_author(); $link = sprintf( '<a href="%1$s" title="%2$s" rel="author external">%3$s</a>', esc_url( $author_url ), /* translators: %s: Author's display name. */ esc_attr( sprintf( __( 'Visit %s’s website' ), $author_display_name ) ), $author_display_name ); /** * Filters the author URL link HTML. * * @since 6.0.0 * * @param string $link The default rendered author HTML link. * @param string $author_url Author's URL. * @param WP_User $authordata Author user data. */ return apply_filters( 'the_author_link', $link, $author_url, $authordata ); } else { return get_the_author(); } }