[wp-trac] [WordPress Trac] #61288: Docstrings don't reflect function return type change.

WordPress Trac noreply at wordpress.org
Fri May 24 08:36:40 UTC 2024


#61288: Docstrings don't reflect function return type change.
-------------------------+-----------------------------
 Reporter:  marherumr    |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Shortcodes   |    Version:  6.5.3
 Severity:  trivial      |   Keywords:  dev-feedback
  Focuses:               |
-------------------------+-----------------------------
 The git commit 10b9642 changed the return type of `shortcode_parse_atts`
 from `array|string` to `array`.

 The docstring for the `pre_do_shortcode_tag` filter in
 [https://github.com/WordPress/WordPress/blob/5359baba0a62a4fd61bcab52f519e6c6e852e2f6
 /wp-includes/shortcodes.php#L423 line 423] and the `do_shortcode_tag`
 filter in
 [https://github.com/WordPress/WordPress/blob/5359baba0a62a4fd61bcab52f519e6c6e852e2f6
 /wp-includes/shortcodes.php#L442 line 442] state that `attr` (the return
 value of `shortcode_parse_atts`) could be array or string.

 Changing the docstring for those two filters would make it clearer to
 developers that no type checking for array oder string is neccessary.

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


More information about the wp-trac mailing list