From 8328ce548ec3b10d63e21f6b1fd8e65d4960c118 Mon Sep 17 00:00:00 2001 From: Amit Sannad Date: Fri, 11 May 2012 03:25:56 +0530 Subject: [PATCH] Add filter to coauthors_posts_links_single to customize attributes while rendering co-author links. Add new attribute rel=author for the link. --- template-tags.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/template-tags.php b/template-tags.php index f1b35458..ecb46f8e 100644 --- a/template-tags.php +++ b/template-tags.php @@ -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( - '%3$s', - get_author_posts_url( $author->ID, $author->user_nicename ), - esc_attr( sprintf( __( 'Posts by %s', 'co-authors-plus' ), get_the_author() ) ), - get_the_author() + '%4$s', + $args['href'], + esc_attr( $args['title'] ), + esc_attr( $args['rel'] ), + $args['text'] ); }