• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Genesis Theme Framework a2z

Genesis Theme Framework a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / Parsed Source / Parsed: 51163
function genesis_post_author_posts_link_shortcode( $atts ) {

  if ( ! post_type_supports( get_post_type(), 'author' ) ) {
    return '';
  }

  $author = get_the_author();

  if ( ! $author ) {
    return '';
  }

  $defaults = [
    'after'  => '',
    'before' => '',
  ];

  $atts = shortcode_atts( $defaults, $atts, 'post_author_posts_link' );

  $url = get_author_posts_url( get_the_author_meta( 'ID' ) );

  $output  = sprintf( '<span %s>', genesis_attr( 'entry-author' ) );
  $output .= $atts['before'];
  $output .= sprintf( '<a href="%s" %s>', $url, genesis_attr( 'entry-author-link' ) );
  $output .= sprintf( '<span %s>', genesis_attr( 'entry-author-name' ) );
  $output .= esc_html( $author );
  $output .= '</span></a>' . $atts['after'] . '</span>';

  return apply_filters( 'genesis_post_author_posts_link_shortcode', $output, $atts );

}
 

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Source ref: genesis_post_author_posts_link_shortcode() – Produces the author of the post (link to author archive).
Parse count / Source file date: 1569839049
MD5 hash: 4adc1a7ab98910cbf8840daa9e7459fe

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.9.3
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  genesis.wp-a2z.org
© Copyright Genesis a2z 2014-2022. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites