PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 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 All 36 releases
← All changes | includes/integrations/acf.php +17 -1 1.4.0 → 1.4.2 View file →
@@ -53,13 +53,15 @@
53 53 add_filter( 'acf/load_value/type=text', array( $this->content_filter, 'filter_post' ) );
54 54 add_filter( 'acf/load_value/type=textarea', array( $this->content_filter, 'filter_post' ) );
55 55 add_filter( 'acf/load_value/type=wysiwyg', array( $this->content_filter, 'filter_post' ) );
56 56 add_filter( 'acf/load_value/type=url', array( $this->content_filter, 'filter_post' ) );
57 + add_filter( 'acf/load_value/type=oembed', array( $this->content_filter, 'filter_post' ) );
57 58 add_filter( 'acf/load_value/type=link', array( $this, 'filter_link_server' ) );
58 59 add_filter( 'acf/update_value/type=text', array( $this->content_filter, 'filter_post_backward' ) );
59 60 add_filter( 'acf/update_value/type=textarea', array( $this->content_filter, 'filter_post_backward' ) );
60 61 add_filter( 'acf/update_value/type=wysiwyg', array( $this->content_filter, 'filter_post_backward' ) );
61 62 add_filter( 'acf/update_value/type=url', array( $this->content_filter, 'filter_post_backward' ) );
63 + add_filter( 'acf/update_value/type=oembed', array( $this->content_filter, 'filter_post_backward' ) );
62 64 add_filter( 'acf/update_value/type=link', array( $this, 'filter_link_provider' ) );
63 65
64 66 /*
65 67 * Image Crop Add-on
@@ -67,8 +69,9 @@
67 69 */
68 70 if ( class_exists( 'acf_field_image_crop' ) ) {
69 71 add_filter( 'wp_get_attachment_metadata', array( $this, 'download_image' ), 10, 2 );
70 72 add_filter( 'sanitize_file_name', array( $this, 'remove_original_after_download' ) );
73 + add_filter( 'wpmcs_do_reupload_media', array( $this, 'force_reupload_during_crop' ), 10, 3 );
71 74 }
72 75
73 76 /*
74 77 * Rewrite URLs in field and field group config.
@@ -146,9 +149,22 @@
146 149 Utils::delete_meta($original_attachment_id, 'acf_cropped_to_remove');
147 150
148 151 return true;
149 152 }
150 -
153 +
154 + /**
155 + * ACF Image Crop Add-on always crops to the field's one fixed configured
156 + * size, so declared dimensions never change between crops — the same blind
157 + * spot shouldForceReupload() has for a flip/180° rotate. Force it explicitly.
158 + * @since 1.4.3
159 + */
160 + public function force_reupload_during_crop( $do_reupload, $attachment_id, $source_type ) {
161 + if ( $do_reupload ) {
162 + return $do_reupload;
163 + }
164 + return $this->compatibility->maybe_process_on_action( 'acf_image_crop_perform_crop', true ) ? true : $do_reupload;
165 + }
166 +
151 167
152 168
153 169 /**
154 170 * Copy back the S3 image for cropping