[wp-trac] [WordPress Trac] #50413: Update code and comments to remove "blacklist" and "whitelist"
WordPress Trac
noreply at wordpress.org
Tue Jul 21 19:03:27 UTC 2020
#50413: Update code and comments to remove "blacklist" and "whitelist"
--------------------------------------+----------------------
Reporter: strangerstudios | Owner: desrosj
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.5
Component: General | Version:
Severity: normal | Resolution: fixed
Keywords: has-patch needs-dev-note | Focuses:
--------------------------------------+----------------------
Comment (by johnjamesjacoby):
I believe I may have discovered a problem: plugins that call `get_option(
'blacklist_keys' )`.
Both bbPress and BuddyPress use this option for preventing the same
undesirable words for Comments from appearing in Forums, Profiles,
Activity, and other such places.
* Previous to WordPress 5.5, it would return results
* Currently, it returns `false`, and also results in an extra database
query as a cache miss
Added to this, the Options API does not have a clever way to announce to
plugins that an option key is deprecated (like `_deprecated_option()` or
something). To support the new key, plugins using `blacklist_keys` need to
do a hard version check, using `is_wp_version_compatible()` or equivalent.
I think it may be appropriate for WordPress to anticipate this situation
internally.
It would be possible using `pre_option_` and `pre_update_option_` hooks to
redirect `get_option()` calls and `update_option()` calls to ensure anyone
using the old `blacklist_keys` key would be interacting with the
`blocklist` equivalent under the hood.
Thoughts?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50413#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list