Skip to content

Commit

Permalink
fix: pr review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HardeepAsrani committed Dec 27, 2024
1 parent a01306d commit ab2d02d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions includes/admin/feedzy-rss-feeds-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -998,12 +998,13 @@ private function save_settings() {
$auto_categories = isset( $_POST['auto-categories'] ) ? filter_input( INPUT_POST, 'auto-categories', FILTER_UNSAFE_RAW, FILTER_REQUIRE_ARRAY ) : array();

$auto_categories = array_filter( $auto_categories, function( $item ) {
if ( ! empty( $item['keywords'] ) && is_numeric( $item['category'] ) ) {
$item['keywords'] = sanitize_text_field( $item['keywords'] );
return true;
}
return false;
} );
return ! empty( $item['keywords'] ) && is_numeric( $item['category'] );
});

$auto_categories = array_map(function( $item ) {
$item['keywords'] = sanitize_text_field( $item['keywords'] );
return $item;
}, $auto_categories );

$auto_categories = array_values( $auto_categories );

Expand Down
2 changes: 1 addition & 1 deletion includes/layouts/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class="<?php echo $_tab === $active_tab ? esc_attr( 'active' ) : ''; ?>"><?php e
<div class="help-text pt-8">
<?php
printf(
// translators: %s is a placeholder for the auto categories tag.
// translators: %s is a placeholder for the auto categories tag, like [#auto_categories].
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' ),
'<strong>[#auto_categories]</strong>'
);
Expand Down

0 comments on commit ab2d02d

Please sign in to comment.