Skip to content

Commit

Permalink
Filter to an author's posts in the proper post type context. Thanks e…
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber committed Aug 6, 2012
1 parent 70d7a30 commit 67993e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion co-authors-plus.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -424,8 +424,14 @@ function _filter_manage_posts_custom_column($column_name) {


$count = 1; $count = 1;
foreach( $authors as $author ) : foreach( $authors as $author ) :
$args = array(
'author_name' => $author->user_login,
);
if ( 'post' != $post->post_type )
$args['post_type'] = $post->post_type;
$author_filter_url = add_query_arg( $args, admin_url( 'edit.php' ) );
?> ?>
<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 ) ) ? ',' : ''; ?> <a href="<?php echo esc_url( $author_filter_url ); ?>"><?php echo esc_html( $author->display_name ); ?></a><?php echo ( $count < count( $authors ) ) ? ',' : ''; ?>
<?php <?php
$count++; $count++;
endforeach; endforeach;
Expand Down

0 comments on commit 67993e3

Please sign in to comment.