PluginProbe
Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score / 3.6
Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score v3.6
trunk 1.0 1.0.1 1.1 1.1.1 1.1.2 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1 2.1.1 2.1.2 2.2 2.2.1 All 69 releases
powered-cache / includes / compat / plugins / advanced-custom-fields.php

advanced-custom-fields.php in Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score 3.6, at includes/compat/plugins/advanced-custom-fields.php

32 lines 687 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Compat with ACF
4 *
5 * @package PoweredCache\Compat
6 * @link https://wordpress.org/plugins/advanced-custom-fields
7 */
8
9 namespace PoweredCache\Compat\AdvancedCustomFields;
10
11 use function PoweredCache\Utils\clean_site_cache_dir;
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit; // Exit if accessed directly.
15 }
16
17
18 /**
19 * Delete page cache on ACF options save
20 *
21 * @param int|string $post_id of the updated page
22 *
23 * @link https://www.advancedcustomfields.com/resources/acf-save_post/
24 */
25 function purge_cache_on_options_save( $post_id ) {
26 if ( 'options' === $post_id ) {
27 clean_site_cache_dir();
28 }
29 }
30
31 add_action( 'acf/save_post', __NAMESPACE__ . '\\purge_cache_on_options_save' );
32