Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions languages/cloudinary.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Cloudinary STABLETAG\n"
"Report-Msgid-Bugs-To: https://github.com/cloudinary/cloudinary_wordpress\n"
"POT-Creation-Date: 2025-09-02 13:12:16+00:00\n"
"POT-Creation-Date: 2025-09-12 09:34:43+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -63,11 +63,11 @@ msgstr[1] ""
msgid "No items found."
msgstr ""

#: php/cache/class-cache-point.php:961 php/class-assets.php:1239
#: php/cache/class-cache-point.php:961 php/class-assets.php:1262
msgid "Cloudinary Asset"
msgstr ""

#: php/cache/class-cache-point.php:962 php/class-assets.php:1240
#: php/cache/class-cache-point.php:962 php/class-assets.php:1263
msgid "Post type to represent a non-media library asset."
msgstr ""

Expand All @@ -87,114 +87,114 @@ msgstr ""
msgid "Enable Cloudinary status"
msgstr ""

#: php/class-assets.php:794
#: php/class-assets.php:817
msgid "Caching"
msgstr ""

#: php/class-assets.php:805
#: php/class-assets.php:828
msgid "Creating shadow assets"
msgstr ""

#: php/class-assets.php:816
#: php/class-assets.php:839
msgid "Updating asset storage"
msgstr ""

#: php/class-assets.php:1283
#: php/class-assets.php:1306
msgid "Additional Asset Sync Settings"
msgstr ""

#: php/class-assets.php:1303
#: php/class-assets.php:1326
msgid "Additional asset sync settings"
msgstr ""

#: php/class-assets.php:1304
#: php/class-assets.php:1327
msgid ""
"Enabling additional asset syncing will sync the toggled assets with "
"Cloudinary to make use of advanced optimization and CDN delivery "
"functionality."
msgstr ""

#: php/class-assets.php:1305
#: php/class-assets.php:1328
msgid "Enable additional asset syncing"
msgstr ""

#: php/class-assets.php:1344
#: php/class-assets.php:1367
msgid "External Asset Sync Settings"
msgstr ""

#: php/class-assets.php:1393 php/class-cache.php:615
#: php/class-assets.php:1416 php/class-cache.php:615
msgid "Plugin"
msgstr ""

#: php/class-assets.php:1429 php/class-cache.php:791
#: php/class-assets.php:1452 php/class-cache.php:791
msgid "Plugins"
msgstr ""

#: php/class-assets.php:1447 php/class-cache.php:808
#: php/class-assets.php:1470 php/class-cache.php:808
msgid "Deliver assets from all plugin folders"
msgstr ""

#: php/class-assets.php:1479 php/class-cache.php:651
#: php/class-assets.php:1502 php/class-cache.php:651
msgid "Theme"
msgstr ""

#: php/class-assets.php:1511 php/class-cache.php:842
#: php/class-assets.php:1534 php/class-cache.php:842
msgid "Themes"
msgstr ""

#: php/class-assets.php:1529 php/class-cache.php:859
#: php/class-assets.php:1552 php/class-cache.php:859
msgid "Deliver all assets from active theme."
msgstr ""

#: php/class-assets.php:1554 php/class-assets.php:1589 php/class-cache.php:683
#: php/class-assets.php:1577 php/class-assets.php:1612 php/class-cache.php:683
#: php/class-cache.php:894
msgid "WordPress"
msgstr ""

#: php/class-assets.php:1563 php/class-cache.php:667
#: php/class-assets.php:1586 php/class-cache.php:667
msgid "WordPress Admin"
msgstr ""

#: php/class-assets.php:1570 php/class-cache.php:674
#: php/class-assets.php:1593 php/class-cache.php:674
msgid "WordPress Includes"
msgstr ""

#: php/class-assets.php:1607 php/class-cache.php:911
#: php/class-assets.php:1630 php/class-cache.php:911
msgid "Deliver all assets from WordPress core."
msgstr ""

#: php/class-assets.php:1633 php/class-assets.php:1659 php/class-cache.php:707
#: php/class-assets.php:1656 php/class-assets.php:1682 php/class-cache.php:707
#: php/class-cache.php:946
msgid "Content"
msgstr ""

#: php/class-assets.php:1640 php/class-cache.php:698
#: php/class-assets.php:1663 php/class-cache.php:698
msgid "Uploads"
msgstr ""

#: php/class-assets.php:1677 php/class-cache.php:963
#: php/class-assets.php:1700 php/class-cache.php:963
msgid "Deliver all content assets from WordPress Media Library."
msgstr ""

#: php/class-assets.php:1701
#: php/class-assets.php:1724
msgid "Enable external assets"
msgstr ""

#: php/class-assets.php:1702
#: php/class-assets.php:1725
msgid ""
"Enabling external assets allows you to sync assets from specific external "
"sources with Cloudinary."
msgstr ""

#: php/class-assets.php:1712
#: php/class-assets.php:1735
msgid "Domains for each external source."
msgstr ""

#: php/class-assets.php:1715
#: php/class-assets.php:1738
msgid "Enter a domain"
msgstr ""

#: php/class-assets.php:1716
#: php/class-assets.php:1739
msgid "Press ENTER or SPACE or type comma or tab to continue."
msgstr ""

Expand Down Expand Up @@ -1290,12 +1290,12 @@ msgstr ""
msgid "Cloudinary %1$s %2$s Transformations"
msgstr ""

#: php/templates/taxonomy-transformation-fields.php:25
#: php/templates/taxonomy-transformation-fields.php:41
#. translators: The taxonomy label.
msgid "Cloudinary %s transformations"
msgstr ""

#: php/templates/taxonomy-transformation-fields.php:35
#: php/templates/taxonomy-transformation-fields.php:51
#. translators: %1$s is the taxonomy label, %2$s is the image settings link,
#. %4$s is the video settings link. The %3$s is the closing tags for the links.
msgid ""
Expand Down
4 changes: 2 additions & 2 deletions php/assets/class-rest-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ public function rest_handle_state( $request ) {
$state = $request['state'];
foreach ( $ids as $id ) {
$where = array(
'post_id' => $id,
'post_state' => 'asset',
'post_id' => $id,
'sync_type' => 'asset',
);
if ( 'delete' === $state ) {
$data = array(
Expand Down
23 changes: 23 additions & 0 deletions php/class-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,32 @@ public function can_sync( $can, $asset_id ) {
$can = false;
}

// If the asset is set to a 'disable' state, we do not allow syncing.
if ( $can && self::is_asset_type( $asset_id ) && $this->is_disable_state( $asset_id ) ) {
$can = false;
}

return $can;
}

/**
* Verify if the asset is set to a 'disable' state.
*
* @param int $asset_id The asset ID to check.
*
* @return bool
*/
protected function is_disable_state( $asset_id ) {
global $wpdb;

$wpdb->cld_table = Utils::get_relationship_table();
$media_context = Utils::get_media_context( $asset_id );
$prepare = $wpdb->prepare( "SELECT `post_state` FROM $wpdb->cld_table WHERE post_id = %d AND media_context = %s;", (int) $asset_id, $media_context ); // phpcs:ignore WordPress.DB.PreparedSQL
$state = $wpdb->get_var( $prepare ); // phpcs:ignore WordPress.DB

return 'disable' === $state;
}

/**
* Check if the post is a asset post type.
*
Expand Down
5 changes: 5 additions & 0 deletions php/class-delivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -1069,6 +1069,11 @@ public function convert_tags( $content, $context = 'view' ) {
if ( empty( $relation['public_id'] || $url === $relation['public_id'] ) ) {
continue; // We don't need the public_id relation item.
}

if ( 'disable' === $relation['post_state'] ) {
continue; // We should not deliver disabled items.
}

$base = $type . ':' . $url;
$public_id = ! is_admin() ? $relation['public_id'] . '.' . $relation['format'] : null;
$cloudinary_url = $this->media->cloudinary_url( $relation['post_id'], array(), $relation['transformations'], $public_id );
Expand Down
20 changes: 18 additions & 2 deletions php/templates/taxonomy-transformation-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,24 @@

wp_add_inline_script( 'cloudinary', 'var CLD_GLOBAL_TRANSFORMATIONS = CLD_GLOBAL_TRANSFORMATIONS ? CLD_GLOBAL_TRANSFORMATIONS : {};', 'before' );

$tax_slug = Utils::get_sanitized_text( 'taxonomy' );
$tax_labels = get_taxonomy_labels( get_taxonomy( $tax_slug ) );
$tax_slug = Utils::get_sanitized_text( 'taxonomy' );

if ( empty( $tax_slug ) ) {
return;
}

$current_taxonomy = get_taxonomy( $tax_slug );

if ( ! $current_taxonomy instanceof WP_Taxonomy ) {
return;
}

$tax_labels = get_taxonomy_labels( $current_taxonomy );

if ( empty( $tax_labels ) ) {
return;
}

$cloudinary = get_plugin_instance();
?>
<div class="cloudinary-collapsible">
Expand Down