From d10102818ce5915262745996027dd8c3a687af99 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 29 Apr 2015 11:32:58 -0400 Subject: [PATCH] Check to see if Ninja form exists as a class --- Gaslightify.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Gaslightify.php b/Gaslightify.php index ab27ffc..a28c52b 100755 --- a/Gaslightify.php +++ b/Gaslightify.php @@ -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 -- 2.17.1