WordPress.org

Ready to get started?Download WordPress

Forums

User Submitted Posts
[resolved] Show pending posts count in sidebar? (3 posts)

  1. alexandery
    Member
    Posted 1 year ago #

    Hello!
    Thank you for this plugin.
    I have a question. Can I show count of user submitted posts? Like "Waiting for moderation: 3 posts". Plugin don't have a widget for this :(

    P.S. Sorry for my English.

    http://wordpress.org/extend/plugins/user-submitted-posts/

  2. Jeff Starr
    Member
    Plugin Author

    Posted 1 year ago #

    Hi alexandery, the plugin doesn't have a built-in way to do this, but it should be possible to query the database and grab the number of pending posts using something like this:

    global $wpdb;
    $query = "SELECT COUNT(*) FROM wp_posts WHERE post_status = 'pending' AND post_author = '$user_id'";
    $post_count = $wpdb->get_var($query);
    $welcomemessage .= "<p>You currently have $post_count submission(s) pending.</p>";
    echo $welcomemessage

    I grabbed this from this thread: http://wordpress.org/support/topic/how-to-retrieve-the-number-of-pending-posts-for-an-author

  3. alexandery
    Member
    Posted 1 year ago #

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.