Make WordPress Core

Ticket #37929: 37929.diff

File 37929.diff, 1.3 KB (added by flixos90, 8 years ago)
  • src/wp-includes/option.php

     
    497497
    498498        wp_protect_special_option( $option );
    499499
     500        /**
     501         * Filters a specific option before its value is deleted.
     502         *
     503         * The dynamic portion of the hook name, `$option`, refers to the option name.
     504         *
     505         * Returning a value other than null will effectively short-circuit the delete process.
     506         *
     507         * @since 4.7.0
     508         *
     509         * @param null   $skip   Whether to short-circuit the process.
     510         * @param string $option Option name.
     511         */
     512        $skip = apply_filters( "pre_delete_option_{$option}", null, $option );
     513
     514        /**
     515         * Filters an option before its value is deleted.
     516         *
     517         * Returning a value other than null will effectively short-circuit the delete process.
     518         *
     519         * @since 4.7.0
     520         *
     521         * @param null   $skip   Whether to short-circuit the process.
     522         * @param string $option Name of the option.
     523         */
     524        $skip = apply_filters( 'pre_delete_option', $skip, $option );
     525
     526        if ( null !== $skip ) {
     527                return (bool) $skip;
     528        }
     529
    500530        // Get the ID, if no ID then return
    501531        $row = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $option ) );
    502532        if ( is_null( $row ) )