Make WordPress Core

Opened 8 years ago

Last modified 7 years ago

#37929 new enhancement

Add `pre_delete_option` filter

Reported by: flixos90's profile flixos90 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Options, Meta APIs Keywords: has-patch
Focuses: Cc:

Description

get_option() and update_option() already have filters to short-circuit their respective processes, so I think a similar filter should be added to delete_option() as well.

Related: #37928

Attachments (2)

37929.diff (1.3 KB) - added by flixos90 8 years ago.
37929.2.diff (926 bytes) - added by flixos90 8 years ago.

Download all attachments as: .zip

Change History (7)

@flixos90
8 years ago

#1 @flixos90
8 years ago

  • Keywords has-patch added; needs-patch removed

37929.diff is a first take on introducing the filter.

#2 @OriginalEXE
8 years ago

Interesting idea.

In your patch, maybe you should use

! is_null( $skip )

instead of

null !== $skip

to keep it consistent with the null check immediately below.

Last edited 8 years ago by OriginalEXE (previous) (diff)

@flixos90
8 years ago

#3 @flixos90
8 years ago

37929.2.diff is an updated patch that gives parity with the latest patch on #37928.

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


7 years ago

Note: See TracTickets for help on using tickets.