Make WordPress Core

Ticket #20448: 20448.2.diff

File 20448.2.diff, 1.4 KB (added by ryan, 13 years ago)

default option filters

  • wp-includes/option.php

     
    4444        if ( defined( 'WP_SETUP_CONFIG' ) )
    4545                return false;
    4646
     47        $default = apply_filters( 'default_option_' . $option, $default );
     48
    4749        if ( ! defined( 'WP_INSTALLING' ) ) {
    4850                // prevent non-existent options from triggering multiple queries
    4951                $notoptions = wp_cache_get( 'notoptions', 'options' );
     
    754756        if ( false !== $pre )
    755757                return $pre;
    756758
     759        $default = apply_filters( 'default_site_option_' . $option, $default );
     760
    757761        if ( !is_multisite() ) {
    758762                $value = get_option($option, $default);
    759763        } else {
  • wp-includes/class-wp-customize-setting.php

     
    6868                        case 'option' :
    6969                                if ( empty( $this->id_data[ 'keys' ] ) )
    7070                                        add_filter( 'pre_option_' . $this->id_data[ 'base' ], array( $this, '_preview_filter' ) );
    71                                 else
     71                                else {
    7272                                        add_filter( 'option_' . $this->id_data[ 'base' ], array( $this, '_preview_filter' ) );
     73                                        add_filter( 'default_option_' . $this->id_data[ 'base' ], array( $this, '_preview_filter' ) );
     74                                }
    7375                                break;
    7476                        default :
    7577                                do_action( 'customize_preview_' . $this->id );