File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ public function convert_cloudinary_version( $attachment_id ) {
6464 $ asset_version = 1 ;
6565 $ asset_transformations = array ();
6666 $ id_parts = array ();
67+ $ public_id = $ this ->get_fetch_public_id ( $ path , $ attachment_id );
6768 foreach ( $ parts as $ val ) {
6869 if ( empty ( $ val ) ) {
6970 continue ;
@@ -140,6 +141,25 @@ public function convert_cloudinary_version( $attachment_id ) {
140141 return $ public_id ;
141142 }
142143
144+ /**
145+ * Maybe the upgraded attachment is a fetch image.
146+ *
147+ * @param string $path The attachment path.
148+ * @param int $attachment_id The attachment ID.
149+ *
150+ * @return string
151+ */
152+ public function get_fetch_public_id ( $ path , $ attachment_id ) {
153+ $ parts = explode ( '/image/fetch/ ' , $ path );
154+
155+ if ( ! empty ( $ parts [1 ] ) ) {
156+ $ this ->media ->update_post_meta ( $ attachment_id , Sync::META_KEYS ['delivery ' ], 'fetch ' );
157+ return $ parts [1 ];
158+ }
159+
160+ return '' ;
161+ }
162+
143163 /**
144164 * Setup hooks for the filters.
145165 */
You can’t perform that action at this time.
0 commit comments