From 3e27653486b2b18a215b46b36e8d11ec9c6f66cc Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@18141 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 3b91775bb3..66e564815d 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; } /**