Title: Integration with Groups plugin
Last modified: December 11, 2018

---

# Integration with Groups plugin

 *  [maxsaf](https://wordpress.org/support/users/maxsaf/)
 * (@maxsaf)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/integration-with-groups-plugin/)
 * Hello!
    Could you add integration with group plugin. For example restricted posts
   or categories of posts should be restricted also and not shown.
    -  This topic was modified 7 years, 7 months ago by [maxsaf](https://wordpress.org/support/users/maxsaf/).
    -  This topic was modified 7 years, 7 months ago by [maxsaf](https://wordpress.org/support/users/maxsaf/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * (@wpdreams)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/integration-with-groups-plugin/#post-11007855)
 * Hi,
 * If you mean this plugin: [https://hu.wordpress.org/plugins/groups/](https://hu.wordpress.org/plugins/groups/)
   ..
   then it might be possible. Looking at their API, there seems to be a function,
   that can tell if the current user has access to a certain post.
 * Using that, I have constructed a custom code, that should remove the results 
   from the results list, to which the current user does not have permissions:
 *     ```
       add_filter('asl_results', 'asl_fix_groups_exclusions', 10, 1);
       function asl_fix_groups_exclusions($results) {
       	if ( class_exists('Groups_Post_Access') ) {
       		foreach ($results as $k => &$r) {
       			if ( !Groups_Post_Access::user_can_read_post($r->id) )
       				unset($results[$k]);
       		}
       	}
   
       	return $results;
       }
       ```
   
 * _Please note, that I have not been able to test this code live, so please be 
   careful when making changes._
 * Best,
    Ernest M.

Viewing 1 replies (of 1 total)

The topic ‘Integration with Groups plugin’ is closed to new replies.

 * ![](https://ps.w.org/ajax-search-lite/assets/icon-256x256.png?rev=3192672)
 * [Ajax Search Lite - Live Search & Filter](https://wordpress.org/plugins/ajax-search-lite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-search-lite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-search-lite/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-search-lite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-search-lite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-search-lite/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [wpdreams](https://wordpress.org/support/users/wpdreams/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/integration-with-groups-plugin/#post-11007855)
 * Status: not resolved