Update for the member only menu
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 17 May 2017 14:31:00 +0000 (10:31 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 17 May 2017 14:31:00 +0000 (10:31 -0400)
The get option needs to use the Constant and not the string. Putting a
check for the define first before creating the menu.

setup/adminHooks.php

index 6a7ad5f..2c45209 100644 (file)
@@ -53,9 +53,9 @@ register_nav_menu($menuSlug, $menuName);
 $menuExists = wp_get_nav_menu_object( $menuName );
 
 // If it doesn't exist, let's create it.
-if( !$menuExists){
+if( !$menuExists && defined( 'GLM_MEMBERS_PLUGIN_MEMBERS_ONLY_ID' ) ){
 
-    $membersOnlyPageID = get_option('GLM_MEMBERS_PLUGIN_MEMBERS_ONLY_ID');
+    $membersOnlyPageID = get_option(GLM_MEMBERS_PLUGIN_MEMBERS_ONLY_ID);
     //
     $menu_id = wp_create_nav_menu($menuName);