Skip to content
This repository
Browse code

Filter to an author's posts in the proper post type context. Thanks e…

  • Loading branch information...
commit 67993e376f504e6811526cd9289497d85c5e2092 1 parent 70d7a30
Daniel Bachhuber authored August 05, 2012

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. 8  co-authors-plus.php
8  co-authors-plus.php
@@ -424,8 +424,14 @@ function _filter_manage_posts_custom_column($column_name) {
424 424
 			
425 425
 			$count = 1;
426 426
 			foreach( $authors as $author ) :
  427
+				$args = array(
  428
+						'author_name' => $author->user_login,
  429
+					);
  430
+				if ( 'post' != $post->post_type )
  431
+					$args['post_type'] = $post->post_type;
  432
+				$author_filter_url = add_query_arg( $args, admin_url( 'edit.php' ) );
427 433
 				?>
428  
-				<a href="<?php echo esc_url( get_admin_url( null, 'edit.php?author_name=' . $author->user_login ) ); ?>"><?php echo esc_html( $author->display_name ); ?></a><?php echo ( $count < count( $authors ) ) ? ',' : ''; ?>
  434
+				<a href="<?php echo esc_url( $author_filter_url ); ?>"><?php echo esc_html( $author->display_name ); ?></a><?php echo ( $count < count( $authors ) ) ? ',' : ''; ?>
429 435
 				<?php
430 436
 				$count++;
431 437
 			endforeach;

0 notes on commit 67993e3

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