mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Coding Standards: Cast wp_count_terms()
result to int
before using in ceil()
.
This addresses two instances of the (numeric string) return value from `wp_count_terms()` being used directly in `ceil()`, which expects an `int|float`. Affected methods: * `WP_Sitemaps_Taxonomies::get_max_num_pages()` * `wp_nav_menu_item_taxonomy_meta_box()` Reference: [https://www.php.net/manual/en/function.ceil.php PHP Manual: ceil()]. Follow-up to [14248], [14291], [14569], [14943], [48072], [57648]. Props justlevine. See #52217. Built from https://develop.svn.wordpress.org/trunk@59462 git-svn-id: http://core.svn.wordpress.org/trunk@58848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
117b935b89
commit
869f9b1df5
@ -875,7 +875,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $data_object, $box ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$num_pages = (int) ceil(
|
$num_pages = (int) ceil(
|
||||||
wp_count_terms(
|
(int) wp_count_terms(
|
||||||
array_merge(
|
array_merge(
|
||||||
$args,
|
$args,
|
||||||
array(
|
array(
|
||||||
|
@ -171,7 +171,7 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
|
|||||||
|
|
||||||
$term_count = wp_count_terms( $this->get_taxonomies_query_args( $taxonomy ) );
|
$term_count = wp_count_terms( $this->get_taxonomies_query_args( $taxonomy ) );
|
||||||
|
|
||||||
return (int) ceil( $term_count / wp_sitemaps_get_max_urls( $this->object_type ) );
|
return (int) ceil( (int) $term_count / wp_sitemaps_get_max_urls( $this->object_type ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.8-alpha-59461';
|
$wp_version = '6.8-alpha-59462';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user