Skip to content

Commit ab2d02d

Browse files
committed
fix: pr review changes
1 parent a01306d commit ab2d02d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

includes/admin/feedzy-rss-feeds-admin.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -998,12 +998,13 @@ private function save_settings() {
998998
$auto_categories = isset( $_POST['auto-categories'] ) ? filter_input( INPUT_POST, 'auto-categories', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY ) : array();
999999

10001000
$auto_categories = array_filter( $auto_categories, function( $item ) {
1001-
if ( ! empty( $item['keywords'] ) && is_numeric( $item['category'] ) ) {
1002-
$item['keywords'] = sanitize_text_field( $item['keywords'] );
1003-
return true;
1004-
}
1005-
return false;
1006-
} );
1001+
return ! empty( $item['keywords'] ) && is_numeric( $item['category'] );
1002+
});
1003+
1004+
$auto_categories = array_map(function( $item ) {
1005+
$item['keywords'] = sanitize_text_field( $item['keywords'] );
1006+
return $item;
1007+
}, $auto_categories );
10071008

10081009
$auto_categories = array_values( $auto_categories );
10091010

includes/layouts/settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ class="<?php echo $_tab === $active_tab ? esc_attr( 'active' ) : ''; ?>"><?php e
199199
<div class="help-text pt-8">
200200
<?php
201201
printf(
202-
// translators: %s is a placeholder for the auto categories tag.
202+
// translators: %s is a placeholder for the auto categories tag, like [#auto_categories].
203203
esc_html__( 'Automatically assign categories to your posts based on their titles. You need to add %s tag to the category field of your import to support this feature.', 'feedzy-rss-feeds' ),
204204
'<strong>[#auto_categories]</strong>'
205205
);

0 commit comments

Comments
 (0)