PluginProbe
Media Cloud Sync / 1.4.1
Media Cloud Sync v1.4.1
1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 All 35 releases
← All changes | includes/integrations/acf.php +10 -10 1.3.111.4.1 View file →
@@ -5,8 +5,15 @@
5 5
6 6 use DirectoryIterator;
7 7 use Exception;
8 8
9 +/**
10 + * ACF Compatibility.
11 + *
12 + * Loaded by the autoloader; activation is gated via `is_installed()` in Integration::init().
13 + *
14 + * @since 1.0.0
15 + */
9 16 class Acf {
10 17 private static $instance = null;
11 18 private $assets_url;
12 19 private $version;
@@ -27,12 +34,9 @@
27 34 $this->settings = Utils::get_settings();
28 35 $this->content_filter = FilterContent::instance();
29 36 $this->compatibility = Compatibility::instance();
30 37
31 - if (self::is_installed()) {
32 - // Register actions
33 - $this->registerActions();
34 - }
38 + $this->registerActions();
35 39 }
36 40
37 41 /**
38 42 * Register integration access
@@ -135,9 +139,9 @@
135 139 return false; //Attachment not to be removed from server
136 140 }
137 141
138 142 // Remove the original file from the server
139 - Item::instance()->may_be_delete_server_files_by_id($original_attachment_id, true);
143 + Item::instance()->may_be_delete_server_files_by_id($original_attachment_id, 'media_library', true);
140 144
141 145 // Remove marker
142 146 Utils::delete_meta($original_attachment_id, 'acf_cropped_to_remove');
143 147
@@ -253,13 +257,9 @@
253 257 *
254 258 * @return bool
255 259 */
256 260 public static function is_installed(): bool {
257 - if ( class_exists( 'acf', false ) ) {
258 - return true;
259 - }
260 -
261 - return false;
261 + return class_exists( 'acf', false );
262 262 }
263 263
264 264 /**
265 265 * Singleton instance