Check to see if Ninja form exists as a class
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 29 Apr 2015 15:32:58 +0000 (11:32 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 29 Apr 2015 15:32:58 +0000 (11:32 -0400)
Gaslightify.php

index ab27ffc..a28c52b 100755 (executable)
@@ -163,7 +163,9 @@ function glm_stats(){
 }
 function Gaslightify_menu() {
     add_menu_page('Server Stats', 'Server Stats', 'edit_posts', 'glm_stats', 'glm_stats', 'dashicons-chart-area');
-    add_menu_page('Form Submissions', 'Form Submissions', 'edit_posts', 'edit.php?post_type=nf_sub', '', 'dashicons-feedback');
+    if (class_exists('Ninja_Forms')) {
+        add_menu_page('Form Submissions', 'Form Submissions', 'edit_posts', 'edit.php?post_type=nf_sub', '', 'dashicons-feedback');
+    }
 }
 add_action('admin_menu', 'Gaslightify_menu');
 /* To give Editors access to the Submissions - Simply replace ‘edit_posts’ in the code snippet below with the capability