• I would like to be able to enable the Empty Cache button for some of my clients who have either the Editor or Shop Manager role. It would be great to have a filter for the current_user_can capability check on line 113.
    ( !is_multisite() && current_user_can( 'activate_plugins' ) ) ||

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I’ll put that on the to-do list. In general, I’m leery about that since

    (a) Adding/editing shop items flushes the relevant cache pages anyway
    (b) On multisite, that gives non-admins a considerable amount of power that could break a network

    Thread Starter Robert Trevellyan

    (@trevellyan)

    Thanks for considering my request.
    a) I believe there are cases where there would be no flush, e.g. a page that displays shortcode output such as [sale_products columns=”3″] in WooCommerce. If someone makes changes to their items on sale, the page is be stale for a while, which leads to confusion. In this case, I want to instruct my client to click the Empty Cache button before they call me reporting a problem.
    b) The line of code I propose amending explicitly excludes multisite.

    For example, if it were changed to something like this:
    ( !is_multisite() && current_user_can( apply_filters( 'vhp_user_can_purge', 'activate_plugins' ) ) ) ||
    then I could add a filter that returns, say, ‘edit_others_posts’.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘feature request: filter for enabling purge button’ is closed to new replies.