Make WordPress Core

Opened 3 years ago

Closed 19 months ago

#53615 closed defect (bug) (duplicate)

wrong typehint for second argument($default) of get_theme_mod

Reported by: mskapusuz's profile mskapusuz Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.7.2
Component: Themes Keywords:
Focuses: docs, coding-standards Cc:

Description

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!

Change History (2)

#1 @SergeyBiryukov
3 years ago

  • Component changed from General to Themes

#2 @SergeyBiryukov
19 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi there, welcome to WordPress Trac!

Thanks for the ticket, sorry it took so long for someone to get back to you.

This appears to be resolved in [51578] / #53399.

Note: See TracTickets for help on using tickets.