Check capabilities per plugin.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 27 Jan 2017 19:03:08 +0000 (14:03 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 27 Jan 2017 19:03:08 +0000 (14:03 -0500)
Use the caps from client info and coupons.

Gaslightify.php

index 861b5f4..4fa1fda 100755 (executable)
@@ -4,7 +4,7 @@
 Plugin Name: Gaslightify
 Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates
 Description: A gasline to a Wordpress website.
-Version: 1.5.4
+Version: 1.5.5
 Author: Gaslight Media
 Author URI: http://www.gaslightmedia.com
 License: Gaslight Media
@@ -44,7 +44,25 @@ function interface_client_safeguard() {
     if ( !current_user_can( 'edit_others_posts' ) ) {
         ?>
         <style type="text/css">
-            #menu-comments, #menu-posts-glm_coupons, #toplevel_page_glmclientinfo {
+            #menu-comments {
+                display: none !important;
+            }
+        </style>
+        <?php
+    }
+    if ( !current_user_can('edit_glmcoupons') ) {
+        ?>
+        <style type="text/css">
+            #menu-posts-glm_coupons {
+                display: none !important;
+            }
+        </style>
+        <?php
+    }
+    if ( !current_user_can('glmclientinfo_edit_client') ) {
+        ?>
+        <style type="text/css">
+            #toplevel_page_glmclientinfo {
                 display: none !important;
             }
         </style>