Codeinwp / feedzy-rss-feeds

FEEDZY RSS Feeds is an easy-to-use plugin giving you RSS aggregator and autoblogging functionality. Bring the best RSS feeds to your site.
GNU General Public License v2.0
79 stars 26 forks source link

Added new fillter for item_url #963

Closed girishpanchal30 closed 3 months ago

girishpanchal30 commented 3 months ago

Add new fillter for item_url

Summary

I've added a new filter to add/remove item link attributes and change the link text.

Will affect visual aspect of the product

Ref: https://tinyurl.com/22kqe3dm

Test instructions

Add the following code snippet to the functions.php file of your current active theme or in any custom plugin file:

add_filter(
    'feedzy_item_link',
    function ( $item_link_data, $item, $job ) {
        // Change link text.
        $item_link_data['text'] = 'LINK TEXT HERE';

        // Add tracking parameters/UTMs.
        $item_link_data['attr']['href'] = add_query_arg(
            array(
                'utm_source'   => '',
                'utm_medium'   => '',
                'utm_campaign' => '',
            ),
            $item_link_data['attr']['href']
        );

        // Change link opening behavior.
        $item_link_data['attr']['target'] = '_self'; // _blank, _self, _parent, _top

        // Add link type - follow/nofollow link.
        $item_link_data['attr']['rel'] = 'nofollow'; // noopener, nofollow.
        return $item_link_data;
    },
    10,
    3
);

Check before Pull Request is ready:

Closes #813

pirate-bot commented 3 months ago

Plugin build for 8758af590c3fc6e088571fd60d464806f55c5ebf is ready :bellhop_bell:!

pirate-bot commented 3 months ago

:tada: This PR is included in version 4.4.13 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: