Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created November 12, 2012 20:47
Show Gist options
  • Save billerickson/4061770 to your computer and use it in GitHub Desktop.
Save billerickson/4061770 to your computer and use it in GitHub Desktop.
/**
* Post Authors Post Link Shortcode
*
* @author Bill Erickson
* @link http://www.billerickson.net/wordpress-post-multiple-authors/
*
* @param array $atts
* @return string $authors
*/
function be_post_authors_post_link_shortcode( $atts ) {
$atts = shortcode_atts( array(
'between' => null,
'between_last' => null,
'before' => null,
'after' => null
), $atts );
$authors = function_exists( 'coauthors_posts_links' ) ? coauthors_posts_links( $atts['between'], $atts['between_last'], $atts['before'], $atts['after'], false ) : $atts['before'] . get_author_posts_url() . $atts['after'];
return $authors;
}
add_shortcode( 'post_authors_post_link', 'be_post_authors_post_link_shortcode' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment