Skip to content

Commit

Permalink
Thanks @felixarntz for suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
  • Loading branch information
mukeshpanchal27 and felixarntz authored Oct 26, 2023
1 parent 8a7bea2 commit 5b63e14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/Admin/Admin_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function render_page() {

// Get user settings for category preferences and set a default value to check all categories by default.
$user_settings = get_user_setting( 'plugin_check_category_preferences', 'all_categories' );
$user_settings = explode( '__', $user_settings );
$user_settings = 'all_categories' === $user_settings ? $categories : explode( '__', $user_settings );

require WP_PLUGIN_CHECK_PLUGIN_DIR_PATH . 'templates/admin-page.php';
}
Expand Down
2 changes: 1 addition & 1 deletion templates/admin-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<fieldset>
<legend class="screen-reader-text"><?php echo esc_html( $category ); ?></legend>
<label for="<?php echo esc_attr( $category ); ?>">
<input type="checkbox" id="<?php echo esc_attr( $category ); ?>" name="categories" value="<?php echo esc_attr( $category ); ?>" <?php checked( in_array( 'all_categories', $user_settings, true ) || in_array( $category, $user_settings, true ) ); ?> />
<input type="checkbox" id="<?php echo esc_attr( $category ); ?>" name="categories" value="<?php echo esc_attr( $category ); ?>" <?php checked( in_array( $category, $user_settings, true ) ); ?> />
<?php echo esc_html( ucfirst( str_replace( '_', ' ', $category ) ) ); ?>
</label>
</fieldset>
Expand Down

0 comments on commit 5b63e14

Please sign in to comment.