Opened 9 years ago
Last modified 6 years ago
#37579 new enhancement
Inconsistent names for `update_(network_)option` actions
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.5.3 |
| Component: | Options, Meta APIs | Keywords: | |
| Focuses: | Cc: |
Description
I noticed that there seems to be some inconsistency in the hook naming convention, regarding the setting, deleting, and updating of options and transients. It would be nice if all the hooks indicated when in the function they were occurring, and matched the others (see the list below).
For example, if all hooks that occurred before the action were prefixed with pre_, and all hooks occurring after were in the past tense: added_, deleted_, updated_. I'm not sure how this was allowed to happen to begin with, so if I'm missing something, please inform and then close this ticket... but if it's simply a result of sloppiness, cleanup should be performed (volunteering myself).
Here is the list of the actions that are performed (in wp-includes/options.php), grouped by when the action fires (before or after):
BEFORE
update_optionadd_optiondelete_optiondelete_transient_{$transient}set_transient_{$transient}pre_delete_site_option_{$option}delete_site_transient_{$transient}
AFTER
add_site_option_{$option}add_site_optionadd_option_{$option}added_optionsetted_transientset_site_transient_{$transient}setted_site_transientupdate_site_option_{$option}update_site_optionupdate_option_{$option}updated_optiondelete_site_option_{$option}delete_site_optiondelete_option_{$option}deleted_optiondeleted_transientdeleted_site_transient
there do appear to be some conflicts with filter names, so all of that would also need to be considered, and a standard established.