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() {