Primary

Filters

Access Control

groups_post_access_user_can_read_post

This filter allows to override the Groups’ verdict on whether a user can access a post.

Parameters

$can_access boolean whether the user can access the post
$post_id int the post ID
$user_id int the user ID

Returns

– boolean whether the user can access the post

groups_filter_the_posts

Whether Groups should apply its the_posts filter. By default, the filter is not applied.

Parameters

$apply boolean whether to apply Groups’ the_posts filter

Returns

– boolean whether to apply Groups’ the_posts filter

Administrative Back End

groups_add_menu_page_function

Determines the function that outputs the Groups menu page.

Parameters

$function string function name

Returns

– string function name

groups_add_submenu_page_function

Invoked when a Groups submenu page is added, determines the function that renders the submenu page.

Parameters

$function string function name

Returns

– string function name

groups_admin_groups_add_form_after_fields

Relates to the admin screen that allows to add a group. This filter allows to add HTML within the form presented to add a group. The filter receives an empty string by default and is expected to return desired additional valid HTML. Use this filter for additional fields that should be processed upon form submission. Use the groups_admin_groups_add_submit_success action to process the additional data.

Parameters

$html string additional valid HTML to be rendered within the form, default: ”

Returns

– string additional HTML to be rendered

groups_admin_groups_edit_form_after_fields

Relates to the admin screen that allows to edit a group. Allows to add HTML within the form used to edit a group. The filter receives an empty string and is expected to return desired additional HTML. Use this filter to for additional fields that should be processed upon form submission. Use the groups_admin_groups_edit_submit_success action to process the additional data.

Parameters

$html string additional valid HTML to be rendered within the form, default: ”
$group_id int the ID of the group

Returns

– string additional HTML to be rendered

groups_footer

Determines the footer content.

Parameters

$footer string content

Returns

– string footer content

Database

groups_get_table_prefix

This filters the prefix of database tables used by Groups. The current WordPress table prefix is used by default. Allowed characters used as the prefix are the characters a-z, A-Z, 0-9 the dash - character and the underscore _ character.

The potential application for this particular filter is e.g. to concentrate all database queries related to Groups’ tables on a single database within the context of a WordPress multisite environment. This would allow to use shared data across its sites.

Parameters

$prefix string the table prefix used

Returns

– string the table prefix to use

Groups and Capabilities

groups_group_can

Determines whether a group has a certain capability.

Parameters

$result boolean current evaluation result, true if the group has the capability, false otherwise
$group Groups_Group the group object
$capability string the capability ID or name that is queried for the group

Returns

– boolean true if the group has the capability, false otherwise

Users and Capabilities

groups_user_can

Whether the user has a certain capability.

Parameters

$result boolean current result; true if the user has the capability, false otherwise
$user Groups_User the Groups User object
$capability string the capability ID or name

Returns

– boolean true if the user has the capability, otherwise false

groups_user_add_role_capabilities

This filter allows to reduce the capabilities that are taken into account when evaluation the user capability set during cache initialization. By default, capabilities that are assigned to the user’s role(s) are added. If false is returned for this filter, they are not added.

Parameters

$value boolean defaults to true, indicating that the user’s role(s) capabilities should also be added to its capability set

Returns

– boolean