• Resolved lucasbustamante

    (@lucasbustamante)


    Hi! I have a website with a very big database, and this query takes a lot of time:

    class RevisionaryAdminPosts {
    // The heavy query populates this array.
    private $post_revision_count = array();

    function __construct() {
    // The heavy query happens here.
    add_action('admin_enqueue_scripts', [$this, 'fltAdminPostsListing'], 50); // 'the_posts' filter is not applied on edit.php for hierarchical types

    // The $post_revision_count array is used here.
    add_filter('display_post_states', [$this, 'flt_display_post_states'], 50, 2);
    add_filter('page_row_actions', [$this, 'revisions_row_action_link']);
    add_filter('post_row_actions', [$this, 'revisions_row_action_link']);
    }
    }

    I would like to remove the hook on “admin_enqueue_scripts”, which will effectively cause $post_revision_count to be empty.

    Is there any concern with doing this? Am I right to assume that it will just not display the “Has Revision” post status (to filter by posts that has revisions) and remove the action link? Will that affect the plugin usability in a fundamental way? (I’m not a user of this system, but a developer, so I don’t know it from a usability POV that’s why I ask ?? )

    Thank you!!!

    Viewing 2 replies - 1 through 2 (of 2 total)
    • Plugin Author Kevin Behrens

      (@kevinb)

      Hello, @lucasbustamante. You are correct that the only result of removing that filter is non-display of the “Has Revision” caption and “Revision Queue” action link for each post that has a revision in the queue.

      Your alternative would be to give the posts table of your database indexes on the comment_count and post_mime_type fields.

      Thread Starter lucasbustamante

      (@lucasbustamante)

      Thanks for the confirmation! ??

    Viewing 2 replies - 1 through 2 (of 2 total)
    • You must be logged in to reply to this topic.