Advertisement
arie_cristianD

add_comment_author_meta

Aug 21st, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. function jnews_the_author_link( $author = null, $print = true ) {
  2.     if ( $print ) {
  3.         printf(
  4.             '<!-- Author Start -->
  5.            <a href="%1$s">%2$s</a>
  6.            <!-- Author End -->',
  7.             esc_url( get_author_posts_url( get_the_author_meta( 'ID', $author ) ) ),
  8.             get_the_author_meta( 'display_name', $author )
  9.         );
  10.     } else {
  11.         return sprintf(
  12.             '<!-- Author Start -->
  13.            <a href="%1$s">%2$s</a>
  14.            <!-- Author End -->',
  15.             esc_url( get_author_posts_url( get_the_author_meta( 'ID', $author ) ) ),
  16.             get_the_author_meta( 'display_name', $author )
  17.         );
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement