Add a filter for is_user_moderated
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 24 Feb 2017 17:01:15 +0000 (12:01 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 24 Feb 2017 17:15:58 +0000 (12:15 -0500)
This will test the userLogginIn array to see if the contact user is
moderated.

setup/adminHooks.php

index a873298..c64224e 100644 (file)
@@ -114,5 +114,16 @@ add_filter(
     2
 );
 
-
+add_filter( 'glm_contact_is_moderated', function( $user ) {
+    if ( isset( $user['contactUser'] )
+        && !in_array(
+            $user['contactUser']['access'],
+            array( $this->config['access_numb']['Full'], $this->config['access_numb']['NotDisplayedNotModerated'] )
+        )
+    ) {
+        return true;
+    } else {
+        return false;
+    }
+} );
 ?>