diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-26 12:57:25 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-26 12:57:25 +0000 |
| commit | 8a8560c1b75ce5cb9f3b86bf3cba19c6df5000ff (patch) | |
| tree | 9a697c0c3029c2b7a5223d818398c562346921e3 /wp-includes/functions.php | |
| parent | c794c54fc14d1a4af6101ace58f8e60da2dc7d98 (diff) | |
| download | wordpress-mu-8a8560c1b75ce5cb9f3b86bf3cba19c6df5000ff.tar.gz wordpress-mu-8a8560c1b75ce5cb9f3b86bf3cba19c6df5000ff.tar.xz wordpress-mu-8a8560c1b75ce5cb9f3b86bf3cba19c6df5000ff.zip | |
WP Merge to rev 4813
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@868 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/functions.php')
| -rw-r--r-- | wp-includes/functions.php | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/wp-includes/functions.php b/wp-includes/functions.php index bb7965e..506de5a 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -204,16 +204,15 @@ function get_option($setting) { global $wpdb, $switched, $current_blog; if ( $switched == false && defined('WP_INSTALLING') == false ) { + // prevent non-existent options from triggering multiple queries + if ( true === wp_cache_get($setting, 'notoptions') ) + return false; $value = wp_cache_get($setting, 'options'); } else { $value = false; wp_cache_delete($setting, 'options'); } -// Uncomment if we get any page not found or rewrite errors -// if( $setting == 'rewrite_rules' ) -// $value = false; - if ( $value == 'novalueindb' ) return false; if ( $value == 'emptystringindb' ) @@ -228,9 +227,9 @@ function get_option($setting) { if( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values $value = $row->option_value; - wp_cache_set($setting, ($value=='')?'emptystringindb':$value, 'options'); - } else { - wp_cache_set($setting, 'novalueindb', 'options'); + wp_cache_set($setting, $value, 'options'); + } else { // option does not exist, so we must cache its non-existence + wp_cache_set($setting, true, 'notoptions'); return false; } } @@ -291,6 +290,9 @@ function update_option($option_name, $newvalue) { return true; } + if ( true === wp_cache_get($option_name, 'notoptions') ) + wp_cache_delete($option_name, 'notoptions'); + $_newvalue = $newvalue; $newvalue = maybe_serialize($newvalue); @@ -1266,24 +1268,10 @@ function wp_die($message, $title = '') { die(); } -function _mce_config_url($url) { - global $wp_locale; - - if ( 'rtl' == $wp_locale->text_direction ) - $url = add_query_arg('mce_text_direction', 'rtl', $url); - - return $url; -} - function _mce_set_direction() { global $wp_locale; - if ( isset($_GET['mce_text_direction']) && 'rtl' == $_GET['mce_text_direction'] ) - $dir = 'rtl'; - else - $dir = $wp_locale->text_direction; - - if ( 'rtl' == $dir ) { + if ('rtl' == $wp_locale->text_direction) { echo 'directionality : "rtl" ,'; echo 'theme_advanced_toolbar_align : "right" ,'; } @@ -1292,12 +1280,7 @@ function _mce_set_direction() { function _mce_load_rtl_plugin($input) { global $wp_locale; - if ( isset($_GET['mce_text_direction']) && 'rtl' == $_GET['mce_text_direction'] ) - $dir = 'rtl'; - else - $dir = $wp_locale->text_direction; - - if ( 'rtl' == $dir ) + if ('rtl' == $wp_locale->text_direction) $input[] = 'directionality'; return $input; @@ -1306,12 +1289,7 @@ function _mce_load_rtl_plugin($input) { function _mce_add_direction_buttons($input) { global $wp_locale; - if ( isset($_GET['mce_text_direction']) && 'rtl' == $_GET['mce_text_direction'] ) - $dir = 'rtl'; - else - $dir = $wp_locale->text_direction; - - if ( 'rtl' == $dir ) { + if ('rtl' == $wp_locale->text_direction) { $new_buttons = array('separator', 'ltr', 'rtl'); $input = array_merge($input, $new_buttons); } |
