Skip to content

Commit

Permalink
Merge pull request #43 from Penske-Media-Corp/develop
Browse files Browse the repository at this point in the history
Add rel=author to coauthor links, and incorporate a new filter for filtering the arguments. Props @mintindeed and @asannad
  • Loading branch information
danielbachhuber committed May 15, 2012
2 parents 74350d9 + ec16b25 commit 44f01ab
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions template-tags.php
Expand Up @@ -198,11 +198,20 @@ function coauthors_posts_links( $between = null, $betweenLast = null, $before =
), null, $echo );
}
function coauthors_posts_links_single( $author ) {
$args = array( 'href' => get_author_posts_url( $author->ID, $author->user_nicename ),
'rel' => 'author',
'title' => sprintf( __( 'Posts by %s', 'co-authors-plus' ), get_the_author() ),
'text' => get_the_author(),
);

$args = apply_filters( 'coauthors_posts_link', $args );

return sprintf(
'<a href="%1$s" title="%2$s">%3$s</a>',
get_author_posts_url( $author->ID, $author->user_nicename ),
esc_attr( sprintf( __( 'Posts by %s', 'co-authors-plus' ), get_the_author() ) ),
get_the_author()
'<a href="%1$s" title="%2$s" rel="%3$s">%4$s</a>',
$args['href'],
esc_attr( $args['title'] ),
esc_attr( $args['rel'] ),
$args['text']
);
}

Expand Down

0 comments on commit 44f01ab

Please sign in to comment.