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

WordPress Trac noreply at wordpress.org
Mon Mar 7 14:43:04 UTC 2022


#51657: Correct displaying the _doing_it_wrong() message for add_theme_support(
'html5' )
-------------------------------------------------+-------------------------
 Reporter:  SergeyBiryukov                       |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.0
Component:  Themes                               |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-screenshots has-patch needs-     |     Focuses:
  dev-note needs-refresh needs-unit-tests        |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

 * status:  accepted => closed
 * resolution:   => fixed


Comment:

 In [changeset:"52828" 52828]:
 {{{
 #!CommitTicketReference repository="" revision="52828"
 Themes: Correct the logic for displaying a `_doing_it_wrong()` notice for
 `add_theme_support( 'html5' )`.

 * Calling `add_theme_support( 'html5' )` without passing an array of
 supported types should throw a `_doing_it_wrong()` notice: "You need to
 pass an array of types".
 * If the second parameter is not specified, it should fall back to an
 array of `comment-list`, `comment-form`, and `search-form` for backward
 compatibility.
 * If the second parameter is not an array, the function should return
 `false`.

 The latter two points are covered by existing unit tests. The first one is
 now addressed by `@expectedIncorrectUsage`.

 Follow-up to [25193], [25235], [25785].

 Props audrasjb, peterwilsoncc, SergeyBiryukov.
 Fixes #51657.
 }}}

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


More information about the wp-trac mailing list