Reputation: 7152
Suppose 2 different contributors submit 2 different posts for admin review, can we find out which contributor pushed which post for review?
If so, where is this information stored in the DB?
Actually, I want to list all posts that were 'submitted for review' by a particular contributor.
Upvotes: 0
Views: 93
Reputation: 360
In the wp_postmeta
table, there is an entry called _edit_last
which gives the ID of the last editing user for a given post. If you want a query that returns all pending posts for a given author ID, regardless of author, you could use something like this:
$params = array(
'post_status' => 'pending',
'meta_key' => '_edit_last',
'meta_value' => user_id
); //Change user_id to the author's ID
$pending_posts_edited = new WP_Query($params);
while($pending_posts_edited->have_posts()) : $pending_posts_edited->the_post(); ?>
//Loop as you normally would
<?php endwhile; ?>
Upvotes: 1