Groups User Query
WordPress plugin that extends WP_User_Query to allow filtering by Group IDs using the Groups plugin
by Yaron Guez · github.com/yaronguez/wp-groups-user-query · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/yaronguez/wp-groups-user-query/archive/refs/heads/master.zipDeclares an update source (https://github.com/yaronguez/wp-groups-user-query), so updates arrive through the plugin's own updater.
Readme
Groups User Query
Contributors: yaronguez
Tags: posts-to-posts
Tested up to: 4.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Extends WP_User_Query to allow filtering by Group IDs from the Groups plugin
Description
Upon activating this plugin, just add a group_ids argument to WP User Query constructor and specify an array of group IDs to filter by:
// Fetch administrators within group 4 or 6
$query = new WP_Query(array(
'role' => 'Administrator',
'group_ids' => [4,6]
));
Simple!
Changelog
= 1.0 =
- Initial version