Skip to content

Commit ad4b226

Browse files
author
Marco Pereirinha
committed
Shortcircuit to enabling flag syncing status
1 parent 9f9e5df commit ad4b226

File tree

1 file changed

+2
-0
lines changed
  • cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,7 @@ public function media_column_value( $column_name, $attachment_id ) {
10961096
'state' => 'inactive',
10971097
'note' => esc_html__( 'Not Synced', 'cloudinary' ),
10981098
);
1099+
add_filter( 'cloudinary_flag_sync', '__return_true' );
10991100
if ( false === $this->cloudinary_id( $attachment_id ) ) {
11001101
// If false, lets check why by seeing if the file size is too large.
11011102
$file = get_attached_file( $attachment_id ); // Get the file size to make sure it can exist in cloudinary.
@@ -1112,6 +1113,7 @@ public function media_column_value( $column_name, $attachment_id ) {
11121113
'note' => esc_html__( 'Synced', 'cloudinary' ),
11131114
);
11141115
}
1116+
remove_filter( 'cloudinary_flag_sync', '__return_true' );
11151117
// filter status.
11161118
$status = apply_filters( 'cloudinary_media_status', $status, $attachment_id );
11171119
?>

0 commit comments

Comments
 (0)