Make WordPress Core

Ticket #28637: 28637d.diff

File 28637d.diff, 540 bytes (added by philipjohn, 10 years ago)
  • src/wp-includes/theme.php

    diff --git src/wp-includes/theme.php src/wp-includes/theme.php
    index 85119ed..7430a08 100644
    function set_theme_mod( $name, $value ) { 
    955955         */
    956956        $mods[ $name ] = apply_filters( "pre_set_theme_mod_$name", $value, $old_value );
    957957
     958    // If the new value is empty, remove it entirely so that get_theme_mod() returns false
     959    if ( '' === $value ) unset( $mods[ $name ] );
     960
    958961        $theme = get_option( 'stylesheet' );
    959962        update_option( "theme_mods_$theme", $mods );
    960963}