[wp-trac] [WordPress Trac] #58012: Replace usage of strpos with str_starts_with

WordPress Trac noreply at wordpress.org
Thu Jun 22 14:12:24 UTC 2023


#58012: Replace usage of strpos with str_starts_with
-------------------------------------------------+-------------------------
 Reporter:  spacedmonkey                         |       Owner:
                                                 |  SergeyBiryukov
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.3
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  good-first-bug has-patch 2nd-        |     Focuses:
  opinion                                        |
-------------------------------------------------+-------------------------
Changes (by SergeyBiryukov):

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


Comment:

 In [changeset:"55987" 55987]:
 {{{
 #!CommitTicketReference repository="" revision="55987"
 Code Modernization: Use `str_starts_with()` in `WP_Theme_JSON` class
 methods.

 This aims to make the code more readable and consistent, as the function
 is already used extensively in core files.

 WordPress core includes a polyfill for `str_starts_with()` on PHP < 8.0 as
 of WordPress 5.9.

 Follow-up to [55703], [55959].

 Props spacedmonkey.
 Fixes #58012.
 }}}

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


More information about the wp-trac mailing list