From 414cdeb52def83c5a119f3c99b64c8c1b1ef79bf Mon Sep 17 00:00:00 2001 From: Aleksandar Atanasov Date: Wed, 10 Sep 2025 17:57:29 +0300 Subject: [PATCH] Fix tax labels error --- .../taxonomy-transformation-fields.php | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/php/templates/taxonomy-transformation-fields.php b/php/templates/taxonomy-transformation-fields.php index 90b04794b..63146ff4b 100644 --- a/php/templates/taxonomy-transformation-fields.php +++ b/php/templates/taxonomy-transformation-fields.php @@ -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(); ?>