From: Anthony Talarico Date: Thu, 25 Oct 2018 15:06:11 +0000 (-0400) Subject: adding check around the adminHooks menu location to check for empty menus X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=abb412ed7688d5875e0ec36d36c517d1dc702287;p=WP-Plugins%2Fglm-member-db.git adding check around the adminHooks menu location to check for empty menus --- diff --git a/setup/adminHooks.php b/setup/adminHooks.php index bda960a5..2b774732 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -110,8 +110,10 @@ if( !$menuExists && defined( 'GLM_MEMBERS_PLUGIN_MEMBERS_ONLY_ID' ) ){ $locations = get_theme_mod( 'nav_menu_locations' ); if(!empty($locations)){ $menu = get_term_by('name', $menuName, 'nav_menu'); - $locations[$menuSlug] = $menu->term_id; - set_theme_mod('nav_menu_locations', $locations); + if($menu){ + $locations[$menuSlug] = $menu->term_id; + set_theme_mod('nav_menu_locations', $locations); + } } add_action( 'add_meta_boxes', function() {