From 4981fd7e4c147dd14161a94720f179757e794aa1 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Sun, 5 Jun 2011 08:53:15 -0600 Subject: [PATCH] adding latest updates from twentyeleven options --- inc/roots-options.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/inc/roots-options.php b/inc/roots-options.php index 9d298c7..9901c93 100644 --- a/inc/roots-options.php +++ b/inc/roots-options.php @@ -30,13 +30,16 @@ function roots_option_page_capability($capability) { add_filter('option_page_capability_roots_options', 'roots_option_page_capability'); function roots_theme_options_add_page() { - add_theme_page( + $theme_page = add_theme_page( __('Theme Options', 'roots'), __('Theme Options', 'roots'), 'edit_theme_options', 'theme_options', 'theme_options_render_page' ); + + if (!$theme_page) + return; } add_action('admin_menu', 'roots_theme_options_add_page'); @@ -84,7 +87,10 @@ function roots_get_default_theme_options() { } function roots_get_theme_options() { - return get_option('roots_theme_options'); + $roots_options = get_option('roots_theme_options'); + if (false === $roots_options) + return roots_get_default_theme_options(); + return $roots_options; } function theme_options_render_page() { @@ -105,7 +111,7 @@ function theme_options_render_page() { -
+
@@ -126,7 +132,7 @@ function theme_options_render_page() { -
+

@@ -136,7 +142,7 @@ function theme_options_render_page() { -
+

@@ -146,7 +152,7 @@ function theme_options_render_page() { -
+