diff --git a/wp-admin/includes/class-walker-category-checklist.php b/wp-admin/includes/class-walker-category-checklist.php index f4d3fbed36..4c6cc9ef31 100644 --- a/wp-admin/includes/class-walker-category-checklist.php +++ b/wp-admin/includes/class-walker-category-checklist.php @@ -81,11 +81,11 @@ class Walker_Category_Checklist extends Walker { $name = 'tax_input[' . $taxonomy . ']'; } - $args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats']; + $args['popular_cats'] = ! empty( $args['popular_cats'] ) ? array_map( 'intval', $args['popular_cats'] ) : array(); $class = in_array( $category->term_id, $args['popular_cats'], true ) ? ' class="popular-category"' : ''; - $args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats']; + $args['selected_cats'] = ! empty( $args['selected_cats'] ) ? array_map( 'intval', $args['selected_cats'] ) : array(); if ( ! empty( $args['list_only'] ) ) { $aria_checked = 'false'; diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index d77d2104da..ad87a89521 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -120,7 +120,7 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) { $args['list_only'] = ! empty( $parsed_args['list_only'] ); if ( is_array( $parsed_args['selected_cats'] ) ) { - $args['selected_cats'] = $parsed_args['selected_cats']; + $args['selected_cats'] = array_map( 'intval', $parsed_args['selected_cats'] ); } elseif ( $post_id ) { $args['selected_cats'] = wp_get_object_terms( $post_id, $taxonomy, array_merge( $args, array( 'fields' => 'ids' ) ) ); } else { @@ -128,7 +128,7 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) { } if ( is_array( $parsed_args['popular_cats'] ) ) { - $args['popular_cats'] = $parsed_args['popular_cats']; + $args['popular_cats'] = array_map( 'intval', $parsed_args['popular_cats'] ); } else { $args['popular_cats'] = get_terms( array( diff --git a/wp-includes/version.php b/wp-includes/version.php index d7b2cb2d4d..7a2fe6daca 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-alpha-48878'; +$wp_version = '5.6-alpha-48880'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.