Skip to content

Commit

Permalink
Fix warning on activating new themes. Fixes #48
Browse files Browse the repository at this point in the history
  • Loading branch information
shadyvb committed Dec 8, 2013
1 parent 648ee36 commit 32b7833
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions connectors/menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ public static function callback_delete_nav_menu( $term, $tt_id, $deleted_term )
public static function callback_update_option_theme_mods( $old, $new )
{
$key = 'nav_menu_locations';
if ( ! isset( $new[$key] ) ) {
return; // Switching themes ?
}

if ( $old[$key] === $new[$key] ) {
return;
}
Expand Down
3 changes: 3 additions & 0 deletions connectors/widgets.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public static function callback_update_option_sidebars_widgets( $old, $new ) {

if ( ! $widget_id ) {
foreach ( $new as $sidebar_id => $new_widgets ){
if ( ! is_array( $old[$sidebar_id] ) || ! is_array( $new_widgets ) ) {
return; // Switching themes ?
}
$old_widgets = $old[$sidebar_id];

// Added ?
Expand Down

0 comments on commit 32b7833

Please sign in to comment.