PluginProbe
Depicter — Popup & Slider Builder / 1.9.2
Depicter — Popup & Slider Builder v1.9.2
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
← All changes | app/hooks.php +6 -7 1.6.21.9.2 View file →
@@ -98,22 +98,21 @@
98 98 return $data;
99 99 }
100 100 add_filter( 'wp_update_attachment_metadata', 'depicter_set_svg_meta_data', 10, 2 );
101 101
102 +function depicter_clear_cache() {
103 + \Depicter::cache('document')->clear();
104 +}
105 +
102 106 function depicter_clear_cache_by_cache_enabler() {
103 107 $cacheEnabled = !empty( $_GET['_cache'] ) && $_GET['_cache'] == 'cache-enabler' ? true : false;
104 108 $isClearAction = !empty( $_GET['_action'] ) && ( $_GET['_action'] == 'clear' || $_GET['_action'] == 'clearurl' );
105 109 if ( $cacheEnabled && $isClearAction && !empty( $_GET['_wpnonce'] ) && wp_verify_nonce( $_GET['_wpnonce'], 'cache_enabler_clear_cache_nonce' ) ) {
106 - $documents = \Depicter::documentRepository()->getList();
107 - if ( !empty( $documents ) ) {
108 - foreach( $documents as $document ) {
109 - \Depicter::cache('document')->delete( $document['id'] );
110 - }
111 - }
110 + depicter_clear_cache();
112 111 }
113 112 }
114 113 add_action( 'init', 'depicter_clear_cache_by_cache_enabler' );
115 -
114 +add_action( 'post_updated', 'depicter_clear_cache' );
116 115
117 116 add_filter( 'style_loader_tag', 'depicter_add_preload_to_styles', 10, 2 );
118 117 function depicter_add_preload_to_styles( $html, $handle ){
119 118 if (strpos( $handle, 'depicter--') === 0) {