Skip to content

Instantly share code, notes, and snippets.

@mchobbel
mchobbel / purge_single_page_non_admin.patch
Last active May 27, 2023 08:29
Regarding https://wordpress.org/plugins/varnish-http-purge 5.1.3 Users with Editor role who are not administrator should be able to use the button "Purge Cache (This Page)".
diff -ru plugin.orig/varnish-http-purge.php plugin.modified/varnish-http-purge.php
--- plugin.orig/varnish-http-purge.php 2023-05-27 10:07:28.893638677 +0200
+++ plugin.modified/varnish-http-purge.php 2023-05-27 10:07:37.241770054 +0200
@@ -410,19 +410,6 @@
);
}
- // If we're on a front end page and the current user can edit published posts, then they can do this.
- if ( ! is_admin() && get_post() !== false && current_user_can( 'edit_published_posts' ) ) {
- $page_url = esc_url( home_url( $wp->request ) );