Skip to content

Commit 26bc56e

Browse files
committed
set ID and delete correct folder
1 parent 041a3c6 commit 26bc56e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync/class-delete-sync.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function delete_asset( $post_id ) {
9595
}
9696
// Next we need to check that the file is in the cloudinary folder.
9797
$parts = explode( '/', $public_id );
98-
$cloudinary_folder = $this->plugin->config['settings']['general']['cloudinary_folder'];
98+
$cloudinary_folder = $this->plugin->config['settings']['sync_media']['cloudinary_folder'] ? $this->plugin->config['settings']['sync_media']['cloudinary_folder'] : '';
9999
if ( $cloudinary_folder === $parts[0] ) {
100100
$type = $this->plugin->components['sync']->managers['push']->get_resource_type( $post_id );
101101
$options = array(

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync/class-push-sync.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ public function push_attachments( $attachments ) {
599599
$meta = wp_get_attachment_metadata( $attachment->ID, true );
600600
$meta[ Sync::META_KEYS['cloudinary'] ] = $meta_data;
601601
wp_update_attachment_metadata( $attachment->ID, $meta );
602+
$this->plugin->components['media']->update_post_meta( $attachment->ID, Sync::META_KEYS['public_id'], $upload['options']['public_id'] );
602603
// Search and update link references in content.
603604
$content_search = new \WP_Query( array( 's' => 'wp-image-' . $attachment->ID, 'fields' => 'ids', 'posts_per_page' => 1000 ) );
604605
if ( ! empty( $content_search->found_posts ) ) {

0 commit comments

Comments
 (0)