• 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.
    • This topic was modified 7 years, 7 months ago by maxsaf.
Viewing 1 replies (of 1 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi,

    If you mean this plugin: 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.