git-svn-id: https://develop.svn.wordpress.org/trunk@1480 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2004-07-23 09:26:37 +00:00
parent 2d87b95f69
commit 4143fbe12c
1 changed files with 9 additions and 4 deletions

View File

@ -296,10 +296,13 @@ function get_settings($setting) {
if ('home' == $setting && '' == $cache_settings->home)
return $cache_settings->siteurl;
if ( isset($cache_settings->$setting) )
if ( isset($cache_settings->$setting) ) :
return $cache_settings->$setting;
else
return @ unserialize( $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'") );
else :
$option = $wpdb->get_var("SELECT option_value FROM $wpdb->options WHERE option_name = '$setting'");
if (@ $kellogs = unserialize($option) ) return $kellogs;
else return $option;
endif;
}
function get_alloptions() {
@ -311,7 +314,9 @@ function get_alloptions() {
if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
if ('category_base' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
@$all_options->{$option->option_name} = unserialize($option->option_value);
if (@ $value = unserialize($option->option_value) ) return $value;
else $value = $option->option_value;
$all_options->{$option->option_name} = $value;
}
}
return $all_options;