Permalink
Browse files

Fix activation first run check

  • Loading branch information...
1 parent 81c449b commit f03fbac8949848c4e9f54a8182e54fc9a4328b69 @swalkinshaw swalkinshaw committed Nov 5, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/activation.php
View
5 lib/activation.php
@@ -25,7 +25,8 @@ function roots_activation_options_page_capability($capability) {
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['first_run'] === 'true') {
$theme_page = add_theme_page(
__('Theme Activation', 'roots'),
__('Theme Activation', 'roots'),
@@ -237,6 +238,7 @@ function roots_theme_activation_action() {
$roots_nav_theme_mod = false;
$primary_nav = wp_get_nav_menu_object('Primary Navigation');
+
if (!$primary_nav) {
$primary_nav_id = wp_create_nav_menu('Primary Navigation', array('slug' => 'primary_navigation'));
$roots_nav_theme_mod['primary_navigation'] = $primary_nav_id;
@@ -255,6 +257,7 @@ function roots_theme_activation_action() {
$primary_nav = wp_get_nav_menu_object('Primary Navigation');
$primary_nav_term_id = (int) $primary_nav->term_id;
$menu_items= wp_get_nav_menu_items($primary_nav_term_id);
+
if (!$menu_items || empty($menu_items)) {
$pages = get_pages();
foreach($pages as $page) {

0 comments on commit f03fbac

Please sign in to comment.