diff --git a/includes/class-kadence-blocks-prebuilt-library-rest-api.php b/includes/class-kadence-blocks-prebuilt-library-rest-api.php index 8dea825f5..992e6c3d4 100644 --- a/includes/class-kadence-blocks-prebuilt-library-rest-api.php +++ b/includes/class-kadence-blocks-prebuilt-library-rest-api.php @@ -874,8 +874,7 @@ public function process_pattern( WP_REST_Request $request ) { // Avoid srcset images. if ( false === strpos( $link, '-150x' ) && - false === strpos( $link, '-300x' ) && - false === strpos( $link, '-1024x' ) + false === strpos( $link, '-300x' ) ) { $image_urls[] = $link; } @@ -910,7 +909,6 @@ public function process_pattern( WP_REST_Request $request ) { } // Regex to find wp:kadence/image blocks with id and src. $pattern = '/(.*?)/s'; - // Use preg_match_all to find all matches if ( preg_match_all( $pattern, $content, $block_matches, PREG_SET_ORDER ) ) { foreach ( $block_matches as $block_match ) { @@ -2402,7 +2400,13 @@ public function check_for_local_image( $image_data ) { $pattern = "/-\d+x\d+/"; // Replace the pattern with an empty string. $cleaned_url = preg_replace( $pattern, '', $image_data['url'] ); - $image_id = attachment_url_to_postid( $cleaned_url ); + if ( $cleaned_url !== $image_data['url'] ) { + $image_id = attachment_url_to_postid( $cleaned_url ); + if ( empty( $image_id ) ) { + $scaled_url = preg_replace( $pattern, '-scaled', $image_data['url'] ); + $image_id = attachment_url_to_postid( $scaled_url ); + } + } } } if ( empty( $image_id ) ) { @@ -2421,7 +2425,7 @@ public function check_for_local_image( $image_data ) { if ( ! empty( $image_id ) ) { $local_image = array( 'id' => $image_id, - 'url' => wp_get_attachment_url( $image_id ), + 'url' => ( ! empty( $image_data['url'] ) && strpos( $image_data['url'], get_site_url() ) !== false ) ? $image_data['url'] : wp_get_attachment_url( $image_id ), ); return array( 'status' => true, diff --git a/readme.txt b/readme.txt index ce0007c0c..3b37bad6f 100644 --- a/readme.txt +++ b/readme.txt @@ -98,8 +98,9 @@ developers of this plugin. == Changelog == = 3.2.23 = -Release Date: February TBD, 2024 +Release Date: February 16th 2024 * Add: "only text" responsive option when using an icon in Advanced button. +* Add: New language selection for AI wizard. * Update: Pattern import to handle advanced forms. * Fix: Responsive font sizes on text in infobox. * Fix: Ability to set icon size to 0 on tablet and mobile in icon block.