diff --git a/CHANGELOG.md b/CHANGELOG.md index c945c12..58050cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ### HEAD +* Fix Theme Activation page issues * Fix issues with root relative URLs and rewrites on non-standard setups * Make sure rewrites are added to .htaccess immediately after activation * Move HTML5 Boilerplate's .htaccess to a [plugin](https://github.com/retlehs/wp-h5bp-htaccess) diff --git a/lib/activation.php b/lib/activation.php index d675f1e..bd8cf1a 100644 --- a/lib/activation.php +++ b/lib/activation.php @@ -8,14 +8,9 @@ if (is_admin() && isset($_GET['activated']) && 'themes.php' == $GLOBALS['pagenow } function roots_theme_activation_options_init() { - if (roots_get_theme_activation_options() === false) { - add_option('roots_theme_activation_options', roots_get_default_theme_activation_options()); - } - register_setting( 'roots_activation_options', - 'roots_theme_activation_options', - 'roots_theme_activation_options_validate' + 'roots_theme_activation_options' ); } add_action('admin_init', 'roots_theme_activation_options_init'); @@ -28,7 +23,7 @@ add_filter('option_page_capability_roots_activation_options', 'roots_activation_ function roots_theme_activation_options_add_page() { $roots_activation_options = roots_get_theme_activation_options(); - if ($roots_activation_options['first_run']) { + if (!$roots_activation_options) { $theme_page = add_theme_page( __('Theme Activation', 'roots'), __('Theme Activation', 'roots'), @@ -46,21 +41,8 @@ function roots_theme_activation_options_add_page() { } add_action('admin_menu', 'roots_theme_activation_options_add_page', 50); -function roots_get_default_theme_activation_options() { - $default_theme_activation_options = array( - 'first_run' => true, - 'create_front_page' => false, - 'change_permalink_structure' => false, - 'change_uploads_folder' => false, - 'create_navigation_menus' => false, - 'add_pages_to_primary_navigation' => false, - ); - - return apply_filters('roots_default_theme_activation_options', $default_theme_activation_options); -} - function roots_get_theme_activation_options() { - return get_option('roots_theme_activation_options', roots_get_default_theme_activation_options()); + return get_option('roots_theme_activation_options'); } function roots_theme_activation_options_render_page() { ?> @@ -73,12 +55,8 @@ function roots_theme_activation_options_render_page() { ?> - -
| @@ -154,32 +132,16 @@ function roots_theme_activation_options_render_page() { ?> |
|---|