Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

commit 67993e376f504e6811526cd9289497d85c5e2092 1 parent 70d7a30
@danielbachhuber danielbachhuber authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 co-authors-plus.php
View
8 co-authors-plus.php
@@ -424,8 +424,14 @@ function _filter_manage_posts_custom_column($column_name) {
$count = 1;
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
$count++;
endforeach;
Please sign in to comment.
Something went wrong with that request. Please try again.