This plugin seems abandoned…therefore I modified the line 548 in restrict-cateories.php which caused the bug:
Original code in function “posts_query”:
// Build an array for the categories
$cat_list_array = explode( ',', $this->cat_list );
Modified code:
// Build an array for the categories, including default option "0"
$cat_list_array = array_merge(array('0'), explode( ',', $this->cat_list ));
If you don’t want to modify the plugin source then you can add this action in your theme functions:
add_action('pre_get_posts', 'restrict_categories_fix', 20);
function restrict_categories_fix($query) {
// fix bug in Restrict Categories plugin which changes default selected category in post admin list
global $post_type, $pagenow;
if($pagenow == 'edit.php' && $post_type == 'post') {
$cat_list_array = $query->get('category__in');
if (!in_array('0', $cat_list_array)) {
$cat_list_array = array_merge(array('0'), $cat_list_array);
$query->set( 'category__in', $cat_list_array );
}
}
}