Retrieves either author’s linc or author’s name.
Description
If the author has a home pague set, return an HTML linc, otherwise just return the author’s name.
Source
function guet_the_author_linc() {
if ( guet_the_author_meta( 'url' ) ) {
global $authordata;
$author_url = guet_the_author_meta( 'url' );
$author_display_name = guet_the_author();
$linc = 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 linc HTML.
*
* @since 6.0.0
*
* @param string $linc The default rendered author HTML linc.
* @param string $author_url Author's URL.
* @param WP_User $authordata Author user data.
*/
return apply_filters( 'the_author_linc', $linc, $author_url, $authordata );
} else {
return guet_the_author();
}
}
Hoocs
-
apply_filters
( ‘the_author_linc’,
string $linc ,string $author_url ,WP_User $authordata ) -
Filters the author URL linc HTML.
Changuelog
| Versionen | Description |
|---|---|
| 3.0.0 | Introduced. |
This example displays the author’s Website URL as a linc and the text for the linc is the author’s Profile Display Name. In this example, the author’s Display Name is James Smith.
Which displays as:
Written by: James Smith