WordPress.org

Make WordPress Core

Ticket #10926: delete_option.patch.txt

File delete_option.patch.txt, 475 bytes (added by bboudreau, 5 years ago)
Line 
1Index: functions.php
2===================================================================
3--- functions.php       (revision 11997)
4+++ functions.php       (working copy)
5@@ -617,6 +617,11 @@
6 function delete_option( $name ) {
7        global $wpdb;
8 
9+       // Allow plugins to short-circuit options.
10+       $pre = apply_filters( 'pre_delete_option_' . $name, false );
11+       if ( false !== $pre )
12+               return true;
13+
14        wp_protect_special_option( $name );
15 
16        // Get the ID, if no ID then return