get_the_author_link()
最后更新于:2021-11-27 01:12:13
get_the_author_link()Retrieve either author’s link or author’s name.
响应
(string|null) An HTML link if the author’s url exist in user meta, else the result of get_the_author().
源文件
文件: gc-includes/author-template.php
function get_the_author_link() {
if ( get_the_author_meta( 'url' ) ) {
return sprintf(
'<a href="https://docs.gechiui.com/functions/get_the_author_link/%1$s" title="%2$s" rel="author external">%3$s</a>',
esc_url( get_the_author_meta( 'url' ) ),
/* translators: %s: Author's display name. */
esc_attr( sprintf( __( 'Visit %s’s website' ), get_the_author() ) ),
get_the_author()
);
} else {
return get_the_author();
}
}