Primary

Actions

The Groups API provides the following actions.


groups_access_meta_boxes_after_groups_read_update

Fires after the post access group IDs were updated for the post.

Parameters

  • $post_id int
  • $group_ids int[]
  • $update_result array

Files

  • lib/access/class-groups-access-meta-boxes.php

groups_access_meta_boxes_before_groups_read_update

Fires before post access group IDs are updated for the post.

Parameters

  • $post_id int
  • $group_ids int[]

Files

  • lib/access/class-groups-access-meta-boxes.php

groups_admin_groups_add_submit_success

Fires after the request to add a group has been successful.

Relates to the admin screen that allows to add a group. It is invoked after the form submission if a new group has been created successfully. It can be used to process additional form data as needed. The action receives a single argument, the ID of the group. Use the groups_admin_groups_add_form_after_fields filter to add appropriate fields to the form.

Parameters

  • $group_id int – the ID of the created group

Files

  • lib/admin/groups-admin-groups-add.php

groups_admin_groups_edit_submit_success

Fires after a request to update a group has been successful.

Relates to the admin screen that allows to edit a group. The action is invoked after form submission if a group has been updated. It can be used to process additional form data related to the updated existing group. The action receives a single argument, the ID of the group. Use the groups_admin_groups_edit_form_after_fields filter to add appropriate fields to the form.

Parameters

  • $group_id int – the ID of the updated group

Files

  • lib/admin/groups-admin-groups-edit.php

groups_admin_groups_handle_action

Handle the requested action and produce the corresponding output.

Parameters

  • $action string – the requested action
  • $group_id string|int – the requested group ID

Files

  • lib/admin/groups-admin-groups.php

groups_admin_groups_handle_action_confirm

Fires after the posted data for an action was accepted.

Should produce output to provide feedback to the user.

Parameters

  • $action string – the requested action

Files

  • lib/admin/groups-admin-groups.php

groups_admin_groups_handle_action_reject

Fires after the posted data for an action was rejected.

Should produce output to provide feedback to the user.

Parameters

  • $action string – the requested action

Files

  • lib/admin/groups-admin-groups.php

groups_admin_groups_handle_bulk_action

Handle the requested bulk action.

Parameters

  • $bulk_action string – the requested bulk action
  • $group_id string|int – the requested group ID

Files

  • lib/admin/groups-admin-groups.php

groups_admin_menu

This action fires after Groups has added the core pages of the Groups menu.

Parameters

  • $pages string[] – hook suffixes of the registered pages

Files

  • lib/admin/class-groups-admin.php

groups_admin_options_legacy

Fires if legacy setting has changed.

Parameters

  • $legacy boolean

Files

  • lib/admin/groups-admin-options.php

groups_created_capability

Fires after a capability has been persisted.

Parameters

  • $result string

Files

  • lib/core/class-groups-capability.php

groups_created_group

Fires after a group has been persisted.

Parameters

  • $result string

Files

  • lib/core/class-groups-group.php

groups_created_group_capability

Fires after a group-capability relation has been persisted.

The relationship establishes that the group and its members possess the capability.

Parameters

  • $group_id string|int
  • $capability_id string|int

Files

  • lib/core/class-groups-group-capability.php

groups_created_user_capability

Fires after a user-capability has been persisted.

Parameters

  • $user_id string|int
  • $capability_id string|int

Files

  • lib/core/class-groups-user-capability.php

groups_created_user_group

Fires after a user-group has been persisted.

Parameters

  • $user_id string|int
  • $group_id string|int

Files

  • lib/core/class-groups-user-group.php

groups_deleted_capability

Fires after a capability has been deleted.

Notes: No additional details about the capability can be retrieved at this point, as the related data has already been removed. An improvement to consider for this action would be to pass details about the deleted capability as a second parameter, for example containing the row data for the deleted capability.

Parameters

  • $result string|int

Files

  • lib/core/class-groups-capability.php

groups_deleted_capability_capability

Fires after a capability has been deleted.

Parameters

  • $capability string

Files

  • lib/core/class-groups-capability.php

groups_deleted_group

Fires after a group has been deleted.

Note: As with deleted capabilities, it should be considered to enhance this action with a second parameter, indicating details about the group, as it is impossible to retrieve these at this point.

Parameters

  • $result string|int

Files

  • lib/core/class-groups-group.php

groups_deleted_group_capability

Fires after a group-capability has been deleted.

Parameters

  • $group_id string|int
  • $capability_id string|int

Files

  • lib/core/class-groups-group-capability.php

groups_deleted_option

Fires after an option has been deleted.

Parameters

  • $option string

Files

  • lib/core/class-groups-options.php

groups_deleted_user_capability

Fires after a user capability has been deleted.

Parameters

  • $user_id int
  • $capability_id int

Files

  • lib/core/class-groups-user-capability.php

groups_deleted_user_group

Fires after a user-group has been deleted.

Parameters

  • $user_id int
  • $group_id int

Files

  • lib/core/class-groups-user-group.php

groups_deleted_user_option

Fires after a user option has been deleted.

Parameters

  • $user_id int
  • $option string

Files

  • lib/core/class-groups-options.php

groups_flushed_options

Fires after options have been deleted.

Files

  • lib/core/class-groups-options.php

groups_network_admin_menu

Fires after Groups core network admin pages have been added.

Parameters

  • $pages string[] – hook suffixes of the registered pages

Files

  • lib/admin/class-groups-admin.php

groups_post_access_wp_count_posts_after_query

Fires after the post count query.

Parameters

  • $query_args array – query parameters
  • $counts array – the counts by post status
  • $type string – the post type
  • $perm string – required permission for posts to be readable

Files

  • lib/access/class-groups-post-access.php

groups_post_access_wp_count_posts_before_query

Fires before the post count query.

Parameters

  • $query_args array – query parameters
  • $counts array – the counts by post status
  • $type string – the post type
  • $perm string – the required permission for posts to be readable

Files

  • lib/access/class-groups-post-access.php

groups_updated_capability

Fires after a capability has been updated.

Parameters

  • $result string|int

Files

  • lib/core/class-groups-capability.php

groups_updated_group

Fires after a group has been updated.

Parameters

  • $result string|int

Files

  • lib/core/class-groups-group.php

groups_updated_group_capability

Fires after a group-capability has been deleted.

Note that currently no changes in the relationship can be recorded.

Parameters

  • $group_id string|int
  • $capability_id string|int

Files

  • lib/core/class-groups-group-capability.php

groups_updated_option

Fires after a option has been updated.

Parameters

  • $option string
  • $new_value mixed

Files

  • lib/core/class-groups-options.php

groups_updated_user_capability

Fires after a user-capability has been updated.

Note that currently no changes in the relationship can be recorded.

Parameters

  • $user_id int
  • $capability_id int

Files

  • lib/core/class-groups-user-capability.php

groups_updated_user_group

Fires after a user-group has been updated.

Note that currently no changes in the relationship can be recorded.

Parameters

  • $user_id int
  • $group_id int

Files

  • lib/core/class-groups-user-group.php

groups_updated_user_option

Fires after a user option has been updated.

Parameters

  • $option string
  • $new_value mixed
  • $user_id int

Files

  • lib/core/class-groups-options.php