PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / trunk
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript vtrunk
4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 All 169 releases
searchpro / inc / thirdparty / hosting / Pantheon.php

Pantheon.php in BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript trunk, at inc/thirdparty/hosting/Pantheon.php

42 lines 1002 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) exit;
3
4 class Pantheon extends berqIntegrations {
5 public $page_url = null;
6
7 function __construct() {
8 add_action('berqwp_flush_all_cache', [$this, 'flush_cache']);
9 add_action('berqwp_stored_page_cache', [$this, 'flush_page_cache']);
10 add_action('berqwp_flush_page_cache', [$this, 'flush_page_cache']);
11 }
12
13 function flush_cache() {
14 if (class_exists('Pantheon_Cache')) {
15 $Pantheon_Cache = new Pantheon_Cache();
16 $Pantheon_Cache->flush_site();
17 }
18 }
19
20 function flush_page_cache($slug) {
21
22 if (!class_exists('Pantheon_Cache')) {
23 return;
24 }
25
26 if (empty($slug)) {
27 $slug = '/';
28 }
29
30 $this->page_url = home_url() . $slug;
31
32 add_filter('pantheon_final_clean_urls', [$this, 'add_page_flush_queue']);
33 }
34
35 function add_page_flush_queue($paths) {
36 $paths[] = $this->page_url;
37
38 return $paths;
39 }
40 }
41
42 new Pantheon();