[wp-trac] [WordPress Trac] #22192: update_option() strict checks can cause false negatives
WordPress Trac
noreply at wordpress.org
Tue Oct 10 16:41:27 UTC 2023
#22192: update_option() strict checks can cause false negatives
--------------------------------------------+--------------------------
Reporter: nacin | Owner: mukesh27
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 6.4
Component: Options, Meta APIs | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests close | Focuses: performance
--------------------------------------------+--------------------------
Comment (by snicco):
Replying to [comment:86 flixos90]:
Sorry, made I a typo.
We use **pre_option_{$option}**, not the catch-all filter to avoid running
the hook callback for any "non-intersting" option.
> While I wish this was true, realistically it isn't the case, since with
WordPress's filter system any call may return something different.
Well I guess, but there is an official API for removing filters. And it
doesn't allow you to add them back either.
The code in question is a hackaround, modifying the internals of the
global hooks.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22192#comment:88>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list