Skip to content

Commit 25aa7a2

Browse files
committed
fix: backward compat
1 parent 0a911a9 commit 25aa7a2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ public function migrate_conditions( $conditions ): string {
116116
return '';
117117
}
118118

119+
// In shortcodes and blocks, sometimes only the keywords are set, and the fields are not set.
120+
$default_field_mappings = array(
121+
'keywords_title' => 'keywords_inc_on',
122+
'keywords_ban' => 'keywords_exc_on',
123+
);
124+
125+
foreach ( $default_field_mappings as $old_key => $new_key ) {
126+
if ( isset( $conditions[ $old_key ] ) && ( ! isset( $conditions[ $new_key ] ) || empty( $conditions[ $new_key ] ) ) ) {
127+
$conditions[ $new_key ] = 'title';
128+
}
129+
}
130+
119131
foreach ( array( 'keywords_title' => 'keywords_inc', 'keywords_ban' => 'keywords_exc' ) as $old_key => $new_key ) {
120132
if ( isset( $conditions[ $old_key ] ) ) {
121133
$conditions[ $new_key ] = $conditions[ $old_key ];

0 commit comments

Comments
 (0)