Ticket #19910: default_option.diff
File default_option.diff, 1.7 KB (added by , 13 years ago) |
---|
-
wp-includes/class-wp-customize-setting.php
68 68 case 'option' : 69 69 if ( empty( $this->id_data[ 'keys' ] ) ) 70 70 add_filter( 'pre_option_' . $this->id_data[ 'base' ], array( $this, '_preview_filter' ) ); 71 else 71 else { 72 72 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 } 73 75 break; 74 76 default : 75 77 do_action( 'customize_preview_' . $this->id ); -
wp-includes/option.php
48 48 // prevent non-existent options from triggering multiple queries 49 49 $notoptions = wp_cache_get( 'notoptions', 'options' ); 50 50 if ( isset( $notoptions[$option] ) ) 51 return $default;51 return apply_filters('default_option_'.$option, $default); 52 52 53 53 $alloptions = wp_load_alloptions(); 54 54 … … 67 67 } else { // option does not exist, so we must cache its non-existence 68 68 $notoptions[$option] = true; 69 69 wp_cache_set( 'notoptions', $notoptions, 'options' ); 70 return $default;70 return apply_filters('default_option_'.$option, $default); 71 71 } 72 72 } 73 73 } … … 78 78 if ( is_object( $row ) ) 79 79 $value = $row->option_value; 80 80 else 81 return $default;81 return apply_filters('default_option_'.$option, $default); 82 82 } 83 83 84 84 // If home is not set use siteurl.