From 660fb346a0ade3d9ba5239dd589a96c5f6d915fb Mon Sep 17 00:00:00 2001 From: "Soare Robert Daniel (Mac 2023)" Date: Tue, 4 Jun 2024 15:49:59 +0300 Subject: [PATCH] chore: comments --- includes/admin/feedzy-rss-feeds-import.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/includes/admin/feedzy-rss-feeds-import.php b/includes/admin/feedzy-rss-feeds-import.php index 178ced3a..7d36b806 100644 --- a/includes/admin/feedzy-rss-feeds-import.php +++ b/includes/admin/feedzy-rss-feeds-import.php @@ -1775,18 +1775,19 @@ function( $term ) { $img_success = true; $feed_img_tag = false === strpos( $import_featured_img, '[[{"value":' ) ? $import_featured_img : '[#item_image]'; // Use feed default image when we are using chained actions. + + // Set the feed image as default value for the image source. if ( strpos( $feed_img_tag, '[#item_image]' ) !== false ) { - // image exists in item - if ( ! empty( $item['item_img_path'] ) ) { + if ( ! empty( $item['item_img_path'] ) ) { // image exists in item $image_source_url = str_replace( '[#item_image]', $item['item_img_path'], $feed_img_tag ); } else { $img_success = false; } - } elseif ( strpos( $feed_img_tag, '[#item_custom' ) !== false ) { - // custom image tag - if ( $this->feedzy_is_business() || $this->feedzy_is_personal() ) { - $value = apply_filters( 'feedzy_parse_custom_tags', $feed_img_tag, $item_obj ); - } + } elseif ( + ( $this->feedzy_is_business() || $this->feedzy_is_personal() ) && // PRO feature. + false !== strpos( $feed_img_tag, '[#item_custom' ) + ) { + $value = apply_filters( 'feedzy_parse_custom_tags', $feed_img_tag, $item_obj ); // custom image tag if ( ! empty( $value ) && strpos( $value, '[#item_custom' ) === false ) { $image_source_url = $value; } else { @@ -1839,7 +1840,7 @@ function( $term ) { } if ( 'yes' === $import_item_img_url || ! $this->tryReuseExistingFeaturedImage( $img_success, $item['item_title'], $new_post_id ) ) { - // Item image action. + // Run chained actions. $import_featured_img = rawurldecode( $import_featured_img ); $import_featured_img = trim( $import_featured_img ); $img_action = $this->get_actions_runner( $import_featured_img, 'item_image' );