[wp-trac] [WordPress Trac] #53615: wrong typehint for second argument($default) of get_theme_mod

WordPress Trac noreply at wordpress.org
Wed Jul 7 10:18:14 UTC 2021


#53615: wrong typehint for second argument($default) of get_theme_mod
------------------------------------+-----------------------------
 Reporter:  mskapusuz               |      Owner:  (none)
     Type:  defect (bug)            |     Status:  new
 Priority:  normal                  |  Milestone:  Awaiting Review
Component:  General                 |    Version:  5.7.2
 Severity:  normal                  |   Keywords:
  Focuses:  docs, coding-standards  |
------------------------------------+-----------------------------
 Hey!


 {{{
 get_theme_mod($name, $default)
 }}}

 accepts two parameter, the second parameter is $default.

 type of the $default has defined as string|false but we can use it as
 array like the $default args of the get_option() function.

 I think, the phpdoc should be mixed instead of string|false on here:
 https://prnt.sc/198s94m

 also on source code:
 https://github.com/WordPress/WordPress/blob/ccdb1766aead26d4cef79badb015bb2727fefd59
 /wp-includes/theme.php#L1000

 thanks!

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


More information about the wp-trac mailing list