Skip to content

Commit c41e76b

Browse files
feat: add support for 'link' field in conditions (#1135)
1 parent af113d0 commit c41e76b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

includes/util/feedzy-rss-feeds-conditions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ public function evaluate_conditions( $default_value, $attrs, $item, $feed_url, $
299299
$image = $admin->feedzy_retrieve_image( $item, $attrs );
300300
$value = $image;
301301
break;
302+
case 'link':
303+
$value = $item->get_link();
304+
break;
302305
default:
303306
$value = '';
304307
break;

js/Conditions/ConditionsControl.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ const SUPPORTED_FIELDS = [
5353
value: 'featured_image',
5454
unsupportedOperators: ['greater_than', 'gte', 'less_than', 'lte'],
5555
},
56+
{
57+
label: __('Link', 'feedzy-rss-feeds'),
58+
value: 'link',
59+
unsupportedOperators: ['greater_than', 'gte', 'less_than', 'lte'],
60+
},
5661
];
5762
const isPro = window.feedzyData.isPro;
5863

@@ -144,7 +149,7 @@ const ConditionsControl = ({ conditions, setConditions }) => {
144149
);
145150
const operators = Object.keys(
146151
window?.feedzyConditionsData?.operators
147-
).filter((key) => !field.unsupportedOperators?.includes(key));
152+
).filter((key) => !field?.unsupportedOperators?.includes(key));
148153

149154
return (
150155
<PanelTab

0 commit comments

Comments
 (0)