[wp-trac] [WordPress Trac] #64773: Code Modernization: Replace usage of strpos() with str_starts_with().

WordPress Trac noreply at wordpress.org
Mon Mar 2 07:56:42 UTC 2026


#64773: Code Modernization: Replace usage of strpos() with str_starts_with().
-------------------------+-----------------------------
 Reporter:  Soean        |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 In 2023 we replaced `0 === strpos()` with `str_starts_with()` see #58012

 In 2024 we introduced a new `0 === strpos()` see
 https://core.trac.wordpress.org/changeset/58313

 To improve readability and performance, we should also update it with
 `str_starts_with()`.

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


More information about the wp-trac mailing list