Skip to content
This repository
Browse code

Merge pull request #43 from Penske-Media-Corp/develop

Add rel=author to coauthor links, and incorporate a new filter for filtering the arguments. Props @mintindeed and @asannad
  • Loading branch information...
commit 44f01ab3605e5c61a312c983ef418435c0330572 2 parents 74350d9 + ec16b25
Daniel Bachhuber authored

Showing 1 changed file with 13 additions and 4 deletions. Show diff stats Hide diff stats

  1. 17  template-tags.php
17  template-tags.php
@@ -198,11 +198,20 @@ function coauthors_posts_links( $between = null, $betweenLast = null, $before =
198 198
 	), null, $echo );
199 199
 }
200 200
 function coauthors_posts_links_single( $author ) {
  201
+	$args = array( 'href' => get_author_posts_url( $author->ID, $author->user_nicename ),
  202
+				   'rel' => 'author',
  203
+				   'title' => sprintf( __( 'Posts by %s', 'co-authors-plus' ), get_the_author() ),
  204
+				   'text' => get_the_author(),
  205
+	);
  206
+
  207
+	$args = apply_filters( 'coauthors_posts_link', $args );
  208
+
201 209
 	return sprintf(
202  
-		'<a href="%1$s" title="%2$s">%3$s</a>',
203  
-		get_author_posts_url( $author->ID, $author->user_nicename ),
204  
-		esc_attr( sprintf( __( 'Posts by %s', 'co-authors-plus' ), get_the_author() ) ),
205  
-		get_the_author()
  210
+			'<a href="%1$s" title="%2$s" rel="%3$s">%4$s</a>',
  211
+			$args['href'],
  212
+			esc_attr( $args['title'] ),
  213
+			esc_attr( $args['rel'] ),
  214
+			$args['text']
206 215
 	);
207 216
 }
208 217
 

0 notes on commit 44f01ab

Please sign in to comment.
Something went wrong with that request. Please try again.