[wp-trac] [WordPress Trac] #51657: Correct displaying the _doing_it_wrong() message for add_theme_support( 'html5' )

WordPress Trac noreply at wordpress.org
Wed Oct 28 15:40:56 UTC 2020


#51657: Correct displaying the _doing_it_wrong() message for add_theme_support(
'html5' )
----------------------------+--------------------
 Reporter:  SergeyBiryukov  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  5.7
Component:  Themes          |    Version:
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+--------------------
 Background: #24932, #51390.

 As a result of [25193], [25235], and [25785] `add_theme_support( 'html5'
 )` is supposed to return `false` and display a `_doing_it_wrong()` notice:
 "You need to pass an array of types".

 As far as I can tell, this has never worked as expected, due to `!
 is_array( $args[0] )` check being in the `elseif` condition after `empty(
 $args[0] )`, which always succeeds in this case.

 Currently, calling `add_theme_support( 'html5' )` without passing an array
 of supported types just silently falls back to `array( 'comment-list',
 'comment-form', 'search-form' )`, without any indication that it is not
 the recommended approach.

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


More information about the wp-trac mailing list