Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options, Meta APIs: Toggle pre_option filters in update_option(). #5448

Conversation

costdev
Copy link
Contributor

@costdev costdev commented Oct 10, 2023

In update_option(), pre_option_{$option} filters are currently removed before getting the "raw" old value, then restored afterwards.

This change performs the same removal/restoration with pre_option filters as well.

Trac ticket: https://core.trac.wordpress.org/ticket/22192

@costdev costdev changed the title Options, Meta APIs: Toggle pre_option filters for the raw old value. Options, Meta APIs: Toggle pre_option filters in update_option(). Oct 10, 2023
@costdev costdev marked this pull request as ready for review October 10, 2023 09:45
@spacedmonkey
Copy link
Member

@felixarntz @costdev This was by design #5313 (comment)

@felixarntz
Copy link
Member

@costdev Per what @spacedmonkey said, I don't think we should remove the generic pre_option (or pre_site_option) filters. The idea is that those could be applied for general changes, such as never hitting the DB for options or something like that. Unhooking those could be severe for special setups like that. Unhooking a specific pre filter though should be okay, given that those would be used only on specific options, thus it would be reasonable to expect the DB isn't bypassed entirely.

@costdev costdev closed this Oct 10, 2023
@costdev
Copy link
Contributor Author

costdev commented Oct 10, 2023

@felixarntz @spacedmonkey Yep no worries. I didn't realise that this was already discussed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants