Viewing 1 replies (of 1 total)
  • Plugin Contributor Inderpreet Singh

    (@inderpreet99)

    I’ve tried to generate some example code below. Take a look at the tests directory to see a lot more examples.

    You should be able to get a list of groups using this:

    $gc = BU_Edit_Groups::get_instance();
    $groups = $gc->get_groups();

    To change complete permissions to a group:

    $users = array( 1, 2 );
    $posts = array( 3, 4 );
    $pages = array( 5, 6 );
    $allowedposts = array( 'allowed' => $posts );
    $allowedpages = array( 'allowed' => $pages );
    
    $updates = array(
    	'name' => 'Test group',
    	'description' => 'Test description',
    	'users' => $users,
    	'perms' => array(
    		'post' => $allowedposts,
    		'page' => $allowedpages,
    		),
    	);
    $gc = BU_Edit_Groups::get_instance();
    $group = $gc->update_group( $group_id, $updates );

Viewing 1 replies (of 1 total)
  • The topic ‘How do I query available groups?’ is closed to new replies.