Skip to content
Permalink
Browse files

Fix #1707 #1710 Use post_id to purge current page (#1714)

Use post_id instead of URL to purge current page
  • Loading branch information...
gidomanders authored and maxicus committed Apr 2, 2019
1 parent 4a7afed commit defaac3b17dcf864f34d70ab1af8558d06964f77
Showing with 6 additions and 3 deletions.
  1. +4 −1 Generic_AdminActions_Flush.php
  2. +2 −2 Generic_Plugin.php
@@ -21,7 +21,10 @@ function w3tc_flush_all() {
}
function w3tc_flush_current_page() {
$url = $_SERVER['HTTP_REFERER'];
$url = filter_input( INPUT_GET, 'url', FILTER_SANITIZE_URL );
if ( empty( $url ) && isset( $_SERVER['HTTP_REFERER'] ) ) {
$url = $_SERVER['HTTP_REFERER'];
}
w3tc_flush_url( $url );
?>
@@ -283,8 +283,8 @@ function admin_bar_menu() {
'parent' => 'w3tc',
'title' => __( 'Purge Current Page', 'w3-total-cache' ),
'href' => wp_nonce_url( admin_url(
'admin.php?page=w3tc_dashboard&w3tc_flush_current_page' ),
'w3tc' )
'admin.php?page=w3tc_dashboard&w3tc_flush_post&post_id=' .
Util_Environment::detect_post_id() ), 'w3tc' )
);
$menu_items['20010.generic'] = array(

0 comments on commit defaac3

Please sign in to comment.
You can’t perform that action at this time.