0

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.

4
  • in the table wp_posts
    – Joren
    Commented Sep 16, 2013 at 18:28
  • Are you using a plug-in or something?
    – Hackerman
    Commented Sep 16, 2013 at 18:28
  • @Joren under which column? post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_content_filtered, post_parent, guid, menu_order, post_type, post_mime_type, comment_count, Commented Sep 16, 2013 at 18:31
  • @RobertRozas No, no plugins. Commented Sep 16, 2013 at 18:32

1 Answer 1

1

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; ?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.