Approve indexed post before publish

Using Post Indexer, and Recent Global Posts plugin. Is there workaround to see whether the indexed post could be listed by manually approving, instead of displaying it automatically via the plugin?

  • Nithin
    • Support Wizard

    Hi Seb,

    I'm checking with the developer regarding this, to see whether there is a quick solution to implement this in the plugin side. Will get back to you in this ticket, once I get a feedback from the developer if there is a possible workaround.

    Have a great weekend ahead. :slight_smile:

    Kind Regards,
    Nithin

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Seb ,

    I've made an 'accompanying' plugin for Post Indexer for you to achieve the modification that you like.

    You can download the attached zip and install it as any other normal plugin and enable it. You can preview the code here as well before installing it: https://gist.github.com/wpmudev-sls/130f0519b5dff3a3200705fa9bb02051 .

    What this does:
    It will by default make all Indexed posts as 'pending' so they won't be listed by the Global Posts plugins. You will find a new page in your super admin called 'Unapproved Posts' that contains a list with all the posts that have a 'pending' status so you can manually view them and Publish whatever you like from that point on.

    As always, create a backup before installing custom code to be on the safe side.

    Tell me if this helps!

    Regards,
    Konstantinos

  • Seb
    • WPMU DEV Initiate

    Wow, it works! :slight_smile:

    Perfect. Only thing. How Can Global Recent post plugin ignore my own posts on the main site? So it only includes the one written by other bloggers under my domain eg. traveller1.portalexplora.com?
    So I want to list only not-mine posts (and accept them first).

    Also How can I change the design of the listing? It's very basic: https://portalexplora.com/explora/

    I would like it to have a thumbnail, categories etc. Like I have on the homepage more or less :slight_frown:

    Seb

  • Seb
    • WPMU DEV Initiate

    Also, I might be asking for a lot. But would it be possible to have "reverse" or "unpublish" button as well? I mean, the user can change the content of the articles after I accept it on my homepage and I will have no option to hide it from my homepage :slight_frown:

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Following up on my latest reply with a code update,

    You can see the latest gist at : https://gist.github.com/wpmudev-sls/130f0519b5dff3a3200705fa9bb02051 ( You can also download it from there or click the Raw button and copy / paste the latest code ).

    It now uses a WP_List_Table so you can extend it if you like for pagination / sorting etc and it has a Publish/Unpublish action.

    I hope this helps as well!

    Regards,
    Konstantinos

  • Seb
    • WPMU DEV Initiate

    W.O.W! Thank you so much!

    I am pretty sure it will be helpful for dozens of people here :slight_smile:

    Can I ask one more thing. Is there a way to add thumbnail from the post instead of the avatar?
    I would like the posts to look genuine like mine on the homepage, just linking to the subsite of one of the user's blog.

    Seb

  • Konstantinos Xenos
    • Rubber Duck Debugger

    No problem Seb I'm glad I could help!

    To change the 'avatar' to a thumbnail you'll have to edit the plugins file since a thumbnail isn't natively supported. I can walk you through it though as it's a fairly easy change. You will of course continue to use your shortcode as [globalrecentposts show_avatars="yes"] but it will show the Featured images instead of avatars.

    To achieve this you'll have to edit the file at:

    \wp-content\plugins\recent-posts\recent-posts.php

    And on lines 84 and 85 you'll find:

    $the_author = network_get_the_author_id();
    $html .= get_avatar( $the_author, $tmp_avatar_size, $default_avatar) . ' ';

    Replace those 2 lines with:

    switch_to_blog( $network_post->BLOG_ID );
    $html .= get_the_post_thumbnail( $network_post->ID );
    restore_current_blog();

    You should now see the featured images instead of avatars. You will have to adjust any CSS styles to your needs as well of course. And don't forget that this change will be deleted if you update the plugin so make sure to remember it and keep it handy if needed in the future.

    Tell me if this worked for you!

    Regards,
    Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.