[wp-trac] [WordPress Trac] #37579: Inconsistent names for `update_(network_)option` actions

WordPress Trac noreply at wordpress.org
Fri Aug 5 03:11:40 UTC 2016


#37579: Inconsistent names for `update_(network_)option` actions
--------------------------------+-----------------------------
 Reporter:  crstauf             |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  4.5.3
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 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`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37579>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list