Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#53615 closed defect (bug) (duplicate)

wrong typehint for second argument($default) of get_theme_mod

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

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
5 years ago

  • Component GeneralThemes

#2 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

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.