Make WordPress Core

Opened 8 years ago

Last modified 5 years ago

#37579 new enhancement

Inconsistent names for `update_(network_)option` actions

Reported by: crstauf's profile crstauf 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_option
  • add_option
  • delete_option
  • delete_transient_{$transient}
  • set_transient_{$transient}
  • pre_delete_site_option_{$option}
  • delete_site_transient_{$transient}

AFTER

  • add_site_option_{$option}
  • add_site_option
  • add_option_{$option}
  • added_option
  • setted_transient
  • set_site_transient_{$transient}
  • setted_site_transient
  • update_site_option_{$option}
  • update_site_option
  • update_option_{$option}
  • updated_option
  • delete_site_option_{$option}
  • delete_site_option
  • delete_option_{$option}
  • deleted_option
  • deleted_transient
  • deleted_site_transient

Change History (1)

#1 @crstauf
8 years ago

there do appear to be some conflicts with filter names, so all of that would also need to be considered, and a standard established.

Note: See TracTickets for help on using tickets.