From e5090f3113057eac3dcafd0c262db4c4501920f2 Mon Sep 17 00:00:00 2001 From: nacin Date: Sat, 4 Jun 2011 22:05:29 +0000 Subject: [PATCH] Sanity check in twentyeleven_get_theme_options() -- if the option doesn't exist, return the default options instead. We already instantiate the option on admin_init. fixes #17686. git-svn-id: http://svn.automattic.com/wordpress/trunk@18141 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyeleven/inc/theme-options.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-content/themes/twentyeleven/inc/theme-options.php b/wp-content/themes/twentyeleven/inc/theme-options.php index 3b91775bb..66e564815 100644 --- a/wp-content/themes/twentyeleven/inc/theme-options.php +++ b/wp-content/themes/twentyeleven/inc/theme-options.php @@ -177,7 +177,10 @@ function twentyeleven_get_default_theme_options() { * @since Twenty Eleven 1.0 */ function twentyeleven_get_theme_options() { - return get_option( 'twentyeleven_theme_options' ); + $options = get_option( 'twentyeleven_theme_options' ); + if ( false === $options ) + return twentyeleven_get_default_theme_options(); + return $options; } /**