From 6d8233700e53eee7d643b2aca92974014c96dd81 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 29 Aug 2008 07:25:45 +0000 Subject: [PATCH] Pass default value to get_option(), fixes #7637 git-svn-id: https://develop.svn.wordpress.org/trunk@8770 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index bb22c5236b..7a2cef988e 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -330,7 +330,7 @@ function is_serialized_string( $data ) { * @param string $setting Name of option to retrieve. Should already be SQL-escaped * @return mixed Value set for the option. */ -function get_option( $setting ) { +function get_option( $setting, $default = false ) { global $wpdb; // Allow plugins to short-circuit options. @@ -341,7 +341,7 @@ function get_option( $setting ) { // prevent non-existent options from triggering multiple queries $notoptions = wp_cache_get( 'notoptions', 'options' ); if ( isset( $notoptions[$setting] ) ) - return false; + return $default; $alloptions = wp_load_alloptions(); @@ -364,7 +364,7 @@ function get_option( $setting ) { } else { // option does not exist, so we must cache its non-existence $notoptions[$setting] = true; wp_cache_set( 'notoptions', $notoptions, 'options' ); - return false; + return $default; } } }