Opened 13 months ago
Last modified 13 months ago
#20651 new enhancement
Inconsistent MS API: delete_site_option action hook is only called AFTER deletion, unlike delete_option
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Multisite | Version: | 3.3.2 |
| Severity: | normal | Keywords: | dev-feedback has-patch |
| Cc: | xoodrew@… |
Description
Unlike the delete_option action hook, the delete_site_option action hook is only called AFTER deletion of the row from the sitemeta table - making it difficult to capture the expiring value (for instance), unless you know its precise option key name ( and hook it using pre_delete_site_option_{$option} ).
Suggest introducing a pre-deletion, non-specific action hook call named "pre_delete_option" for options and "pre_delete_site_option" for site options, for consistency.
Attachments (2)
Change History (8)
comment:1
SergeyBiryukov — 13 months ago
- Component changed from General to Multisite
- Keywords dev-feedback added; delete_site_option MS removed
comment:4
danielnashnz — 13 months ago
To keep it consistent with delete_option and delete_site_option, shouldn't $option be passed as well in the do_action calls?
SergeyBiryukov — 13 months ago
Obviously, 'pre_delete_site_option' is useless if we don't pass the $option. Sergey already submitted a fixed patch.
comment:6
DrewAPicture — 13 months ago
- Cc xoodrew@… added

What a mess. 20651.diff: