[wp-trac] [WordPress Trac] #61352: PHP deprecation notice in wp_title()

WordPress Trac noreply at wordpress.org
Sun Nov 9 19:27:50 UTC 2025


#61352: PHP deprecation notice in wp_title()
-----------------------------------+------------------------
 Reporter:  nexbridge              |       Owner:  joedolson
     Type:  defect (bug)           |      Status:  reopened
 Priority:  normal                 |   Milestone:  6.9
Component:  Themes                 |     Version:  6.5.5
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch 2nd-opinion  |     Focuses:
-----------------------------------+------------------------

Comment (by joedolson):

 I think that this makes sense. This value really shouldn't ever be
 anything other than a string; even if it is numeric, the variable type
 should be `string`. This change just makes sure of this.

 I wonder a little whether we should cast numerics to strings, in case
 somebody somewhere is passing a float or int to this. But if they're
 returning a non-string on a filter that expects a string return, then
 that's really just `_doing_it_wrong()`. Technically, the case we're
 handling is already doing it wrong, by not returning or returning null,
 though, so it seems reasonale to also handle other related cases.

 The problem with `explode` is really that it errors if the value passed is
 null or not stringy. If we're protected against passing any non-string
 values, then it can just be exploded.

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


More information about the wp-trac mailing list