Make WordPress Core

Ticket #44042: 44042.1.diff

File 44042.1.diff, 1.2 KB (added by palmiak, 6 years ago)

Patch with added documentation

  • src/wp-includes/option.php

    diff --git a/src/wp-includes/option.php b/src/wp-includes/option.php
    index a80de70..ff145b4 100644
    a b function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) 
    548548function delete_option( $option ) {
    549549        global $wpdb;
    550550
    551         $option = trim( $option );
     551        /**
     552         * Filters the option name before deleting.
     553         *
     554         * @since x.x.x
     555         *
     556         * @param string $option Option ID.
     557        */
     558
     559        $option = trim( apply_filters( 'delete_option_name', $option ));
     560
    552561        if ( empty( $option ) ) {
    553562                return false;
    554563        }