[wp-trac] [WordPress Trac] #60800: Twenty Twenty-One: prevent PHP 8 fatal error from non-string in $tags_list

WordPress Trac noreply at wordpress.org
Wed Apr 3 14:51:41 UTC 2024


#60800: Twenty Twenty-One: prevent PHP 8 fatal error from non-string in $tags_list
-------------------------------------------------+-------------------------
 Reporter:  josephscott                          |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.6
Component:  Bundled Theme                        |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch needs-      |     Focuses:
  testing 2nd-opinion                            |
-------------------------------------------------+-------------------------
Changes (by sabernhardt):

 * keywords:  good-first-bug has-patch changes-requested => good-first-bug
     has-patch needs-testing 2nd-opinion


Comment:

 `get_the_tag_list()` returns either a string, `false` or the `WP_Error`.
 Twenty Twenty-One should only need to add a condition for the error (as PR
 6290 does).

 The condition `if ( $tags_list && is_string( $tags_list ) )` is another
 possibility. If that is preferred, however, it would belong in nine themes
 to be consistent.

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


More information about the wp-trac mailing list