Skip to content

Commit f11d629

Browse files
author
Marco Pereirinha
committed
Leverage the new method to check if auto sync is enabled
1 parent 412a38f commit f11d629

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function handle_bulk_actions( $location, $action, $post_ids ) {
167167
* @return bool
168168
*/
169169
public function auto_sync_enabled( $enabled, $post_id ) {
170-
if ( isset( $this->plugin->config['settings']['sync_media']['auto_sync'] ) && 'on' === $this->plugin->config['settings']['sync_media']['auto_sync'] ) {
170+
if ( $this->plugin->components['settings']->is_auto_sync_enabled() ) {
171171
$enabled = true;
172172
}
173173

cloudinary-image-management-and-manipulation-in-the-cloud-cdn/ui-definitions/tabs/sync-media-content.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
* @package Cloudinary
66
*/
77

8-
$autosync = false;
9-
if ( isset( $this->plugin->config['settings']['sync_media']['auto_sync'] ) && 'on' === $this->plugin->config['settings']['sync_media']['auto_sync'] ) {
10-
$autosync = true;
11-
}
8+
$autosync = $this->plugin->components['settings']->is_auto_sync_enabled();
129
?>
1310
<?php if ( ! empty( $this->plugin->config['connect'] ) ) : ?>
1411
<div class="settings-tab-section-card">

0 commit comments

Comments
 (0)