[wp-trac] [WordPress Trac] #64262: Coding Standards: Fix improper @return tag documentation across core files

WordPress Trac noreply at wordpress.org
Mon Nov 17 10:10:33 UTC 2025


#64262: Coding Standards: Fix improper @return tag documentation across core files
-----------------------------+-----------------------------
 Reporter:  huzaifaalmesbah  |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  General          |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Fixes `@return` tag documentation violations in WordPress core to comply
 with [https://developer.wordpress.org/coding-standards/inline-
 documentation-standards/php/ PHP Documentation Standards].

 '''Changes:'''
  * Replace `boolean`/`Boolean` with `bool`
  * Replace `integer`/`Integer` with `int`
  * Add descriptions to `@return` tags (type + description required per
 standards)

 '''Files Modified:''' 10 files, 29 functions total
  * wp-includes: `class-wp-theme-json-resolver.php`, `block-
 supports/elements.php`, `class-json.php`, `formatting.php`, `comment.php`,
 `functions.php`
  * wp-admin/includes: `plugin.php`, `widgets.php`, `user.php`,
 `upgrade.php`

 '''Example:'''
 {{{
 #!php
 // Before
 @return integer|null

 // After
 @return int|null
 }}}

 {{{
 #!php
 // Before
 @return string

 // After
 @return string The base name of the given path.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64262>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list