The get option needs to use the Constant and not the string. Putting a
check for the define first before creating the menu.
$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);