Make WordPress Core

Ticket #37929: 37929.2.diff

File 37929.2.diff, 926 bytes (added by flixos90, 8 years ago)
  • src/wp-includes/option.php

     
    497497
    498498        wp_protect_special_option( $option );
    499499
     500        /**
     501         * Filters whether to short-circuit the process of removing an option.
     502         *
     503         * Returning a value other than null will short-circuit the process, and the value will be
     504         * returned cast as a bool.
     505         *
     506         * @since 4.7.0
     507         *
     508         * @param null   $skip   Whether to short-circuit the process.
     509         * @param string $option Name of the option to remove.
     510         */
     511        $skip = apply_filters( 'pre_delete_option', null, $option );
     512        if ( ! is_null( $skip ) ) {
     513                return (bool) $skip;
     514        }
     515
    500516        // Get the ID, if no ID then return
    501517        $row = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $option ) );
    502518        if ( is_null( $row ) )