I have a custom post type, when I view my posts of this type in the dashboard I see: Title Author Date Added as well as a few more I have added
My question is how can I display (like the author column) the user which approved/published the post
Ideally I would like to be able to click on the name and view the publishers published posts
function my_manage_product_columns( $column, $post_id ) {
global $post;
switch( $column ) {
case 'publisher' :
$publisher = get_the_modified_author();
$link = sprintf( '<a href="%s">%s</a>',
esc_url( add_query_arg( array( 'post_type' => 'product', 'genre' => $term->slug ), 'edit.php' ) ),
esc_html( sanitize_term_field( 'name', $term->name, $term->term_id, 'genre', 'display' ) )
)
echo $link;
break;
/* Just break out of the switch statement for everything else. */
default :
break;
}
}
add_action( 'manage_product_posts_custom_column', 'my_manage_product_columns', 10, 2 );
I found an example online sorting by genre but I don't know how to modify it (what to replace the variables with)
'genre' => $term->slug
$term->name
$term->term_id