Created
August 15, 2012 18:26
-
-
Save wpsmith/3362153 to your computer and use it in GitHub Desktop.
Get all Users who are not editors or administrators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // prepare arguments | |
| $args = array( | |
| 'role' => 'author', | |
| 'query_id' => 'wps_not_author', | |
| 'meta_query' => array( | |
| array( | |
| 'key' => 'wpsand_capabilities', | |
| 'value' => '"editor"', | |
| 'compare' => 'not like', | |
| ), | |
| array( | |
| 'key' => 'wpsand_capabilities', | |
| 'value' => '"administrator"', | |
| 'compare' => 'not like', | |
| ), | |
| ), | |
| ); | |
| // Create the WP_User_Query object | |
| $author_query = new WP_User_Query( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment