From f193617b86aaf619631464a999393e5a42d6ebb3 Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Thu, 1 Aug 2024 11:54:53 +0530 Subject: [PATCH 1/4] Add new fillter for item_url --- includes/admin/feedzy-rss-feeds-import.php | 27 +++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/includes/admin/feedzy-rss-feeds-import.php b/includes/admin/feedzy-rss-feeds-import.php index 3784e2e4..0e7613d0 100644 --- a/includes/admin/feedzy-rss-feeds-import.php +++ b/includes/admin/feedzy-rss-feeds-import.php @@ -1470,7 +1470,30 @@ private function run_job( $job, $max ) { $item_link_txt = apply_filters( 'feedzy_invoke_auto_translate_services', $item_link_txt, '[#item_url]', $import_translation_lang, $job, $language_code, $item ); } - $item_link = '' . $item_link_txt . ''; + $item_link_data = apply_filters( + 'feedzy_item_link', + array( + 'text' => $item_link_txt, + 'attr' => array( + 'href' => $item['item_url'], + 'target' => '_blank', + 'class' => 'feedzy-rss-link-icon', + ), + ), + $item, + $job + ); + $item_link_attr = isset( $item_link_data['attr'] ) ? $item_link_data['attr'] : array(); + $item_link_attr = array_map( + function ( $attr, $key ) { + return sprintf( '%1$s="%2$s"', $key, esc_attr( $attr ) ); + }, + $item_link_attr, + array_keys( $item_link_attr ) + ); + + $item_link_txt = isset( $item_link_data['text'] ) ? $item_link_data['text'] : $item_link_txt; + $item_link = '' . $item_link_txt . ''; // Rewriter item title from feedzy API. if ( $rewrite_service_endabled && false !== strpos( $post_title, '[#title_feedzy_rewrite]' ) ) { @@ -1478,8 +1501,6 @@ private function run_job( $job, $max ) { $post_title = str_replace( '[#title_feedzy_rewrite]', $title_feedzy_rewrite, $post_title ); } - $item_link = '' . __( 'Read More', 'feedzy-rss-feeds' ) . ''; - $image_html = ''; if ( ! empty( $item['item_img_path'] ) ) { $image_html = ''; From 37e3e0d8ec8be67b1dfbdc02c347c294d125b8ac Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Thu, 1 Aug 2024 16:27:47 +0530 Subject: [PATCH 2/4] Remove WP default rel --- includes/admin/feedzy-rss-feeds-import.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/admin/feedzy-rss-feeds-import.php b/includes/admin/feedzy-rss-feeds-import.php index 0e7613d0..3caed268 100644 --- a/includes/admin/feedzy-rss-feeds-import.php +++ b/includes/admin/feedzy-rss-feeds-import.php @@ -1483,6 +1483,12 @@ private function run_job( $job, $max ) { $item, $job ); + + // Remove WordPress default link rel. + if ( isset( $item_link_data['attr']['rel'] ) ) { + add_filter( 'wp_targeted_link_rel', '__return_null' ); + } + $item_link_attr = isset( $item_link_data['attr'] ) ? $item_link_data['attr'] : array(); $item_link_attr = array_map( function ( $attr, $key ) { From 8758af590c3fc6e088571fd60d464806f55c5ebf Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Thu, 1 Aug 2024 23:38:46 +0530 Subject: [PATCH 3/4] Override WP default link rel --- includes/admin/feedzy-rss-feeds-import.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/admin/feedzy-rss-feeds-import.php b/includes/admin/feedzy-rss-feeds-import.php index 3caed268..6c065f64 100644 --- a/includes/admin/feedzy-rss-feeds-import.php +++ b/includes/admin/feedzy-rss-feeds-import.php @@ -1485,8 +1485,14 @@ private function run_job( $job, $max ) { ); // Remove WordPress default link rel. - if ( isset( $item_link_data['attr']['rel'] ) ) { - add_filter( 'wp_targeted_link_rel', '__return_null' ); + $link_rel = isset( $item_link_data['attr']['rel'] ) ? $item_link_data['attr']['rel'] : ''; + if ( $link_rel ) { + add_filter( + 'wp_targeted_link_rel', + function() use ( $link_rel ) { + return $link_rel; + } + ); } $item_link_attr = isset( $item_link_data['attr'] ) ? $item_link_data['attr'] : array(); From e192c285bdbf2be9a7dce15d0288e7c9b6037c5e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 09:07:23 +0000 Subject: [PATCH 4/4] chore(deps): bump codeinwp/themeisle-sdk from 3.3.25 to 3.3.28 Bumps [codeinwp/themeisle-sdk](https://github.com/Codeinwp/themeisle-sdk) from 3.3.25 to 3.3.28. - [Release notes](https://github.com/Codeinwp/themeisle-sdk/releases) - [Changelog](https://github.com/Codeinwp/themeisle-sdk/blob/master/CHANGELOG.md) - [Commits](https://github.com/Codeinwp/themeisle-sdk/compare/v3.3.25...v3.3.28) --- updated-dependencies: - dependency-name: codeinwp/themeisle-sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index e20a311b..dd0a734e 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "codeinwp/themeisle-sdk", - "version": "3.3.25", + "version": "3.3.28", "source": { "type": "git", "url": "https://github.com/Codeinwp/themeisle-sdk.git", - "reference": "29b7c81f8ccd039f49d62ef7427a4cc06369becc" + "reference": "cd35fd5356ba169b9a0419ba879764ffeb811b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/29b7c81f8ccd039f49d62ef7427a4cc06369becc", - "reference": "29b7c81f8ccd039f49d62ef7427a4cc06369becc", + "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/cd35fd5356ba169b9a0419ba879764ffeb811b63", + "reference": "cd35fd5356ba169b9a0419ba879764ffeb811b63", "shasum": "" }, "require-dev": { @@ -42,9 +42,9 @@ ], "support": { "issues": "https://github.com/Codeinwp/themeisle-sdk/issues", - "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.25" + "source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.28" }, - "time": "2024-07-08T13:49:14+00:00" + "time": "2024-08-09T08:54:15+00:00" } ], "packages-dev": [