[wp-trac] [WordPress Trac] #57580: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in functions.php

WordPress Trac noreply at wordpress.org
Tue Feb 28 21:48:00 UTC 2023


#57580: strpos(): Passing null to parameter #1 ($haystack) of type string is
deprecated  in functions.php
-------------------------------------+---------------------
 Reporter:  ipajen                   |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  6.3
Component:  General                  |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  PHP81 close 2nd-opinion  |     Focuses:
-------------------------------------+---------------------

Comment (by SergeyBiryukov):

 On a related note, per @joostdevalk, some plugins also call
 `wp_add_inline_style()` with null as`$handle`.

 if we move forward with a `_doing_it_wrong()` notice here,
 `wp_add_inline_style()` could probably use a similar approach if `$handle`
 is null, via the existing `_wp_scripts_maybe_doing_it_wrong()` function.

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


More information about the wp-trac mailing list