[wp-trac] [WordPress Trac] #56849: Modify `_config_wp_home()` and `_config_wp_siteurl()` to become pre_option filters
WordPress Trac
noreply at wordpress.org
Mon Jan 23 18:29:09 UTC 2023
#56849: Modify `_config_wp_home()` and `_config_wp_siteurl()` to become pre_option
filters
------------------------------------+---------------------
Reporter: flixos90 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.2
Component: Options, Meta APIs | Version: 2.2
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses:
------------------------------------+---------------------
Comment (by costdev):
Apologies for the delay in getting to respond to all of the items Felix.
I think migrating may cause an issue for extenders using
`remove_all_filters()` on `option_home` or `option_siteurl`, as these will
now exist on a different hook and we can't reliably remove those.
Conditionally calling `apply_filters( "option_{$option}" )` for `home` and
`siteurl` should still work fine for `remove_all_filters()`.
We could still handle `remove_filter()` though, by checking if the
callback also exists in the `pre_option_home` / `pre_option_siteurl`
filters and removing it there too. In terms of performance, it looks like
`remove_filter()` and `WP_Hook::remove_filter()` do `isset()` lookups, so
performance impact should be minimal.
What do you think?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56849#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list