[wp-trac] [WordPress Trac] #64704: Code Modernization: Replace void in PHPDoc union return types with null in various core files

WordPress Trac noreply at wordpress.org
Mon Mar 30 05:34:44 UTC 2026


#64704: Code Modernization: Replace void in PHPDoc union return types with null in
various core files
--------------------------+--------------------------
 Reporter:  apermo        |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  reviewing
 Priority:  normal        |   Milestone:  7.1
Component:  General       |     Version:  3.9
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+--------------------------
Changes (by westonruter):

 * keywords:  has-patch => needs-patch


Comment:

 I didn't have r62178 close this ticket, because I found (via Claude)
 additional instances that still need to be fixed in `wp-includes`:

 **`void|string` (echo/display pattern):**
 - `author-template.php:452` — `wp_list_authors()`
 - `general-template.php:239,382,522,702,2000,2270` — `get_search_form()`,
 `wp_loginout()`, `wp_login_form()`, `wp_register()`, `wp_get_archives()`,
 `get_calendar()`
 - `comment-template.php:491,1244,2230` — `comment_class()`,
 `trackback_url()`, `wp_list_comments()`
 - `post-template.php:40,79,1301,1424` — `the_title()`,
 `the_title_attribute()`, `wp_list_pages()`, `wp_page_menu()`
 - `bookmark-template.php:209` — `wp_list_bookmarks()`
 - `link-template.php:3257` — `wp_get_shortlink()`
 - `category-template.php:535,713` — `wp_list_categories()`,
 `wp_tag_cloud()`
 - `nav-menu-template.php:59` — `wp_nav_menu()`

 **`void|false`:**
 - `functions.php:886` — `wp_set_post_tags()` (alias)
 - `general-template.php:25,69,113,165` — `get_header()`, `get_footer()`,
 `get_sidebar()`, `get_template_part()`
 - `theme.php:2692` — `set_theme_mod()`
 - `taxonomy.php:3819` — `clean_object_term_cache()`
 - `category-template.php:1455` — `wp_generate_tag_cloud()` (false path)
 - `comment.php:3093` — `pingback()`
 - `user.php:1990` — `wp_set_password()`

 **`void|WP_Error`:**
 - `class-wp-metadata-lazyloader.php:78,118` — `queue_objects()`,
 `reset_queue()`
 - `class-wp-image-editor-imagick.php:401` — `set_quality()`
 - `class-wp-xmlrpc-server.php:1391`
 - `rest-api/endpoints/class-wp-rest-edit-site-export-controller.php:73`

 **`void|false` in wpdb:**
 - `class-wpdb.php:1797,3940` — `show_errors()`, `print_error()`

 **Other:**
 - `class-wp-customize-setting.php:522` — `save()` (`void|false`)

 That's roughly **40+ instances** still remaining in `wp-includes/`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64704#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list