Skip to content

Commit

Permalink
Fix Phan error
Browse files Browse the repository at this point in the history
  • Loading branch information
mmtr committed Dec 18, 2024
1 parent 7f1e6a2 commit 0b33e38
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ function wpcom_set_default_category() {
return;
}

$new_default_category = get_category( sanitize_text_field( wp_unslash( $_GET['category'] ) ) );
$new_default_category_id = sanitize_text_field( wp_unslash( $_GET['category'] ) );
if ( ! is_numeric( $new_default_category_id ) ) {
return;
}

$new_default_category = get_category( (int) $new_default_category_id );
if ( is_wp_error( $new_default_category ) || ! $new_default_category ) {
return;
}
Expand Down

0 comments on commit 0b33e38

Please sign in to comment.