Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Ticket #62762 (WP_Widget_Categories::widget(): use int or bool for $cat_args values ...) closed

Дата публикации: 16-10-2026 20:14:01

fixed:
In 64413:
Widgets: Use booleans in Categories widget arguments.
The Categories widget passed show_count and hierarchical to wp_list_categories() and wp_dropdown_categories() as the numeric strings '0' and '1', while both functions document these arguments as bool|int. They are now passed as booleans, matching what the Categories block already passes. Core only checks these values for truthiness, so output is unchanged; a callback on the widget_categories_args or widget_categories_dropdown_args filter that compares them strictly to '1' or '0' is the only code affected, which is noted in the filters' @since tags.
The arguments passed to those filters, along with the widget's display arguments and instance settings, are now documented as hashes so that static analysis can type them. The count, hierarchical and dropdown settings are documented as the 0 or 1 that update() stores, while widget() keeps reading them loosely for instances saved before WordPress 2.8, which stored booleans. A missing title in the submitted settings no longer triggers an undefined array key warning in update(), which can happen when REST API form data omits it.
Developed in ​https://github.com/WordPress/wordpress-develop/pull/8071.
Follow-up to r10809, r41685, r64331.
Props westonruter, marian1.
See #65817, #65860.
Fixes #62762.


Основное содержимое страницы с новостью.

Javascript required

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Changeset [64413]: Widgets: Use booleans in Categories widget arguments. The Categories ...07.4416-10-2026
2Ticket #66324 (The wp.updates QUnit tests have never run) closed06.9716-10-2026
3Changeset [64418]: Tests: Strengthen Recent Comments widget XHTML coverage. Assert that ...09.9816-10-2026
4Changeset [64424]: Tests: Add coverage for `get_the_category_list()`. Cover unordered ...014.0416-10-2026
5Changeset [64422]: Tests: Add coverage for `WP_Widget_Links`. Cover bookmark rendering, ...011.916-10-2026
6Changeset [64421]: Tests: Add coverage for `WP_Widget_Block`. Cover rendered block ...014.2916-10-2026
7Ticket #66328 (Recovery mode does not recognize network-activated plugins) created05.9216-10-2026
8Changeset [64419]: Tests: Correct missing-URL coverage for the RSS widget. Fix the ...013.516-10-2026
9Ticket #66325 (Abilities API: Allow abilities to declare required capabilities) created06.0216-10-2026
10Changeset [64417]: Tests: Add coverage for `wp_sprintf()` and `wp_sprintf_l()`. Cover ...010.6716-10-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 6.91. Источник: core.trac.wordpress.org.