Hi there McGee,
Good evening. I trust you are well and safe!
Perhaps this could be of help to you:
https://github.com/itthinx/groups/blob/ac918b544b0c2ff31eb8fa9290bbdbf36de87cb3/legacy/access/class-groups-post-access-legacy.php
Precisely, Groups_Post_Access_Legacy::get_read_post_capabilities( $post_id ).
STAY SAFE and be awesome!
Best,
Eugen.
Plugin Author
Kento
(@proaktion)
Hi,
I would strongly advise against using legacy functions such as the one @eugenbleck mentions. Especially if you are in the process of creating a new 3rd party integration, that would be something that you should definitely avoid.
@howdy_mcgee I’d rather point you directly to this function https://github.com/itthinx/groups/blob/master/lib/core/class-groups-capability.php#L206 which allows you to obtain the entry for a named capability, of which you can obtain the corresponding capability_id used to identify that within Groups.
Illustrative example for the publish_posts capability:
$capability = Groups_Capability::read_by_capability( 'publish_posts' );
if ( $capability ) {
$capability_id = $capability->capability_id;
}
Marking as resolved as I would assume that this is what you were looking for, but do feel free to ask if you need further help on this.
Cheers