Contents
groups_get_group( int $group_id )
Fetch a single group object.
Description
When calling up a group object, you should always use this function instead of instantiating BP_Groups_Group directly, so that you will inherit cache support and pass through the groups_get_group filter.
Parameters
- $group_id
-
(Required) ID of the group.
Return
(BP_Groups_Group) $group The group object.
Source
File: bp-groups/bp-groups-functions.php
function groups_get_group( $group_id ) { /* * Backward compatibilty. * Old-style arguments take the form of an array or a query string. */ if ( ! is_numeric( $group_id ) ) { $r = bp_parse_args( $group_id, array( 'group_id' => false, 'load_users' => false, 'populate_extras' => false, ), 'groups_get_group' ); $group_id = $r['group_id']; } $group = new BP_Groups_Group( $group_id ); /** * Filters a single group object. * * @since BuddyPress 1.2.0 * * @param BP_Groups_Group $group Single group object. */ return apply_filters( 'groups_get_group', $group ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.2.0 | Introduced. |
Related
Uses
Uses | Description |
---|---|
bp-groups/classes/class-bp-groups-group.php: BP_Groups_Group::__construct() |
Constructor method. |
bp-groups/bp-groups-functions.php: groups_get_group |
Filters a single group object. |
bp-core/bp-core-functions.php: bp_parse_args() |
Merge user defined arguments into defaults array. |
Used By | Description |
---|---|
bp-messages/classes/class-bp-messages-thread.php: BP_Messages_Thread::get_threads_for_user() |
Get message threads. |
bp-media/bp-media-template.php: bp_get_media_link() |
Return the media link. |
bp-media/classes/class-bp-rest-media-endpoint.php: BP_REST_Media_Endpoint::bp_rest_check_privacy_restriction() |
Check user access based on the privacy for the single Media. |
bp-media/classes/class-bp-rest-media-albums-endpoint.php: BP_REST_Media_Albums_Endpoint::bp_rest_check_album_privacy_restriction() |
Check user access based on the privacy for the single album. |
bp-document/classes/class-bp-rest-document-folder-endpoint.php: BP_REST_Document_Folder_Endpoint::bp_rest_check_folder_privacy_restriction() |
Check user access based on the privacy for the single folder. |
bp-document/classes/class-bp-rest-document-endpoint.php: BP_REST_Document_Endpoint::document_get_prepare_response() |
Prepare object response for the document/folder. |
bp-document/classes/class-bp-rest-document-endpoint.php: BP_REST_Document_Endpoint::bp_rest_check_privacy_restriction() |
Check user access based on the privacy for the single document. |
bp-document/classes/class-bp-rest-document-endpoint.php: BP_REST_Document_Endpoint::get_items_permissions_check() |
Checks if a given request has access to get all users. |
bp-activity/bp-activity-functions.php: bp_activity_get_edit_data() |
Get the Activity edit data. |
bp-activity/bp-activity-filters.php: bp_activity_edit_update_media() |
Update media and activity for media updation and deletion while editing the activity. |
bp-activity/bp-activity-filters.php: bp_activity_edit_update_document() |
Update document and activity for document updation and deletion while editing the activity. |
bp-document/classes/class-bp-document.php: BP_Document::get_document_data() |
Convert document IDs to document objects, as expected in template loop. |
bp-document/classes/class-bp-document.php: BP_Document::get_folder_data() |
Convert document IDs to document objects, as expected in template loop. |
bp-document/classes/class-bp-document-folder.php: BP_Document_Folder::get_folder_data() |
Convert document IDs to document objects, as expected in template loop. |
bp-document/bp-document-template.php: bp_get_document_link() |
Return the document link. |
bp-document/bp-document-template.php: bp_get_folder_link() |
Return the folder description. |
bp-document/bp-document-template.php: bp_get_folder_folder_link() | |
bp-document/bp-document-functions.php: bp_document_user_can_manage_folder() |
Check user have a permission to manage the folder. |
bp-document/bp-document-functions.php: bp_document_user_can_manage_document() |
Check user have a permission to manage the document. |
bp-document/bp-document-functions.php: bp_document_folder_bradcrumb() |
This function will give the breadcrumbs html. |
bp-templates/bp-nouveau/includes/document/ajax.php: bp_nouveau_ajax_document_get_folder_view() | |
bp-templates/bp-nouveau/includes/document/ajax.php: bp_nouveau_ajax_document_folder_delete() |
Delete folder. |
bp-templates/bp-nouveau/includes/messages/ajax.php: bp_nouveau_get_thread_messages() |
messages for each thread. |
bp-notifications/classes/class-bp-rest-notifications-endpoint.php: BP_REST_Notifications_Endpoint::bp_rest_get_notification_actions() |
Action to perform. |
bp-notifications/classes/class-bp-rest-notifications-endpoint.php: BP_REST_Notifications_Endpoint::bp_rest_link_url_update() |
Update Link URL after request accept/reject. |
bp-messages/bp-messages-functions.php: bp_messages_get_avatars() |
Get Message thread avatars by thread id. |
bp-messages/bp-messages-functions.php: group_messages_notification_new_message() |
Email message recipients to alert them of a new unread group message. |
bp-messages/bp-messages-filters.php: bp_messages_add_user_to_group_message_thread() |
Remove member to Group thread when h/she joined the group. |
bp-messages/classes/class-bp-rest-messages-endpoint.php: BP_REST_Messages_Endpoint::prepare_message_for_response() |
Prepares message data for the REST response. |
bp-messages/classes/class-bp-rest-messages-endpoint.php: BP_REST_Messages_Endpoint::prepare_item_for_response() |
Prepares thread data for return as an object. |
bp-messages/classes/class-bp-rest-messages-endpoint.php: BP_REST_Messages_Endpoint::bp_rest_messages_get_avatars() |
Get avatars for the messages thread. |
bp-messages/bp-messages-filters.php: bp_group_messages_groups_membership_accepted() |
Add new message to a existing group thread when someone membership is accepted in group. |
bp-messages/bp-messages-filters.php: bp_group_messages_join_new_member() |
Add new message to a existing group thread when someone join in group. |
bp-messages/bp-messages-filters.php: bp_group_messages_remove_group_member_from_thread() |
Add new message to a existing group thread when someone remove from group. |
bp-messages/bp-messages-filters.php: bp_group_messages_accept_new_member() |
Add new message to group thread if new member joined the group. |
bp-messages/bp-messages-filters.php: bp_group_messages_banned_member() |
Add new message to group thread when someone from the group ban. |
bp-messages/bp-messages-filters.php: bp_group_messages_admin_banned_member() |
Add new message to group thread when someone from the group ban. |
bp-messages/bp-messages-filters.php: bp_group_messages_unbanned_member() |
Add new message to group thread when someone from the group unban. |
bp-media/bp-media-functions.php: bp_media_user_can_manage_album() |
Check user have a permission to manage the album. |
bp-media/bp-media-functions.php: bp_media_user_can_manage_media() |
Check user have a permission to manage the media. |
bp-media/classes/class-bp-rest-media-endpoint.php: BP_REST_Media_Endpoint::get_items_permissions_check() |
Checks if a given request has access to get all users. |
bp-integrations/learndash/buddypress/Hooks.php: Hooks::groupMemberDeleted() |
Hook on user group deleted. |
bp-groups/bp-groups-activity.php: bp_groups_get_activity_group() |
Get the group object the activity belongs to. |
bp-groups/bp-groups-activity.php: bp_groups_format_activity_action_activity_update() |
Format groups ‘activity_update’ activity actions. |
bp-groups/classes/class-bp-rest-group-settings-endpoint.php: BP_REST_Group_Settings_Endpoint::update_courses_fields() |
Update Group Courses settings. |
bp-groups/classes/class-bp-rest-group-settings-endpoint.php: BP_REST_Group_Settings_Endpoint::get_settings_fields() |
Get Group Settings. |
bp-groups/classes/class-bp-rest-group-settings-endpoint.php: BP_REST_Group_Settings_Endpoint::update_settings_fields() |
Update Group settings. |
bp-groups/classes/class-bp-rest-group-settings-endpoint.php: BP_REST_Group_Settings_Endpoint::get_forum_fields() |
Get Group forum Settings. |
bp-groups/classes/class-bp-rest-group-settings-endpoint.php: BP_REST_Group_Settings_Endpoint::update_forum_fields() |
Update Group Forum settings. |
bp-groups/classes/class-bp-rest-group-settings-endpoint.php: BP_REST_Group_Settings_Endpoint::get_courses_fields() |
Get Group course Settings. |
bp-groups/classes/class-bp-rest-groups-endpoint.php: BP_REST_Groups_Endpoint::get_group_object() |
Get group object. |
bp-groups/classes/class-bp-groups-invitation-manager.php: BP_Groups_Invitation_Manager::run_send_action() |
This is where custom actions are added to run when notifications of an invitation or request need to be generated & sent. |
bp-forums/classes/class-bp-rest-topics-endpoint.php: BP_REST_Topics_Endpoint::prepare_item_for_response() |
Prepares component data for return as an object. |
bp-forums/classes/class-bp-rest-forums-endpoint.php: BP_REST_Forums_Endpoint::can_access_content() |
Check current access permission. |
bp-forums/classes/class-bp-rest-forums-endpoint.php: BP_REST_Forums_Endpoint::get_sub_forums() |
Get sub forums. |
bp-forums/classes/class-bp-rest-forums-endpoint.php: BP_REST_Forums_Endpoint::bp_rest_get_group() |
Get Forum’s group. |
bp-activity/bp-activity-filters.php: bp_activity_media_add() |
Create media activity for each media uploaded |
bp-activity/bp-activity-filters.php: bp_activity_document_add() |
Create document activity for each document uploaded |
bp-activity/classes/class-bp-rest-activity-endpoint.php: BP_REST_Activity_Endpoint::prepare_item_for_database() |
Prepare an activity for create or update. |
bp-activity/classes/class-bp-rest-activity-endpoint.php: BP_REST_Activity_Endpoint::prepare_links() |
Prepare links for the request. |
bp-forums/functions.php: bbp_forum_update_forum_status_when_group_updates() |
Update Forum status depending on the group status |
bp-forums/groups.php: BBP_Forums_Group_Extension::redirect_canonical() |
Ensure that forum content associated with a BuddyBoss group can only be viewed via the group URL. |
bp-forums/groups.php: BBP_Forums_Group_Extension::map_activity_to_group() |
Map a forum post to its corresponding group in the group activity stream. |
bp-forums/groups.php: BBP_Forums_Group_Extension::maybe_map_permalink_to_group() |
Maybe map a Forums forum/topic/reply permalink to the corresponding group |
bp-forums/groups.php: BBP_Forums_Group_Extension::toggle_group_forum() |
Toggle the enable_forum group setting on or off |
bp-forums/activity.php: BBP_BuddyPress_Activity::group_forum_topic_activity_action_callback() | |
bp-forums/activity.php: BBP_BuddyPress_Activity::group_forum_reply_activity_action_callback() | |
bp-media/bp-media-template.php: bp_get_album_link() |
Return the album description. |
bp-media/classes/class-bp-media-album.php: BP_Media_Album::get_album_data() |
Convert media IDs to media objects, as expected in template loop. |
bp-media/classes/class-bp-media.php: BP_Media::get_media_data() |
Convert media IDs to media objects, as expected in template loop. |
bp-messages/bp-messages-notifications.php: messages_format_notifications() |
Format notifications for the Messages component. |
bp-groups/bp-groups-admin.php: bp_groups_admin_edit() |
Display the single groups edit screen. |
bp-groups/bp-groups-admin.php: bp_groups_admin_load() |
Set up the Groups admin page. |
bp-groups/screens/user/invites.php: groups_screen_group_invites() |
Handle the loading of a user’s Groups > Invites page. |
bp-groups/actions/create.php: groups_action_create_group() |
Catch and process group creation form submissions. |
bp-groups/classes/class-bp-group-extension.php: BP_Group_Extension::group_access_protection() |
Filter the access check in bp_groups_group_access_protection() for this extension. |
bp-groups/classes/class-bp-group-extension.php: BP_Group_Extension::setup_access_settings() |
Set up access-related settings for this extension. |
bp-groups/classes/class-bp-groups-template.php: BP_Groups_Template::__construct() |
Constructor method. |
bp-groups/classes/class-bp-groups-list-table.php: BP_Groups_List_Table::prepare_items() |
Set up items for display in the list table. |
bp-groups/classes/class-bp-groups-group-members-template.php: BP_Groups_Group_Members_Template::__construct() |
Constructor. |
bp-groups/classes/class-bp-groups-member-suggestions.php: BP_Groups_Member_Suggestions::validate() |
Validate and sanitise the parameters for the suggestion service query. |
bp-groups/classes/class-bp-groups-component.php: BP_Groups_Component::setup_globals() |
Set up component global data. |
bp-groups/bp-groups-functions.php: bp_groups_get_invited_by() |
Get inviter for member’s group invitation |
bp-groups/bp-groups-functions.php: bp_groups_get_invite_messsage_for_user() |
Get user’s invite message. |
bp-groups/bp-groups-functions.php: groups_post_update() |
Post an Activity status update affiliated with a group. |
bp-groups/bp-groups-functions.php: groups_join_group() |
Add a user to a group. |
bp-groups/bp-groups-functions.php: groups_edit_base_group_details() |
Edit the base details for a group. |
bp-groups/bp-groups-functions.php: groups_edit_group_settings() |
Edit the base details for a group. |
bp-groups/bp-groups-functions.php: groups_delete_group() |
Delete a group and all of its associated metadata. |
bp-groups/bp-groups-functions.php: groups_get_slug() |
Get a group slug by its ID. |
bp-groups/bp-groups-activity.php: bp_groups_group_details_updated_add_activity() |
Add an activity item when a group’s details are updated. |
bp-groups/bp-groups-functions.php: groups_create_group() |
Create a group. |
bp-groups/bp-groups-activity.php: bp_groups_membership_accepted_add_activity() |
Add an activity feed item when a member joins a group. |
bp-groups/bp-groups-activity.php: bp_groups_format_activity_action_created_group() |
Format ‘created_group’ activity actions. |
bp-groups/bp-groups-activity.php: bp_groups_format_activity_action_joined_group() |
Format ‘joined_group’ activity actions. |
bp-groups/bp-groups-template.php: bp_get_group_member_joined_since() |
Return the joined date for the current member in the group member loop. |
bp-groups/bp-groups-template.php: bp_get_parent_group_id() |
Get the parent group ID for a specific group. |
bp-groups/bp-groups-template.php: bp_group_list_parents() |
Output markup listing group parents. |
bp-groups/bp-groups-filters.php: bp_groups_user_can_filter() |
Filter the bp_user_can value to determine what the user can do with regards to a specific group. |
bp-groups/bp-groups-filters.php: bp_groups_allow_mods_to_delete_activity() |
Filter the bp_activity_user_can_delete value to allow moderators to delete activities of a group. |
bp-groups/bp-groups-notifications.php: groups_notification_group_updated() |
Notify all group members when a group is updated. |
bp-groups/bp-groups-notifications.php: groups_notification_new_membership_request() |
Notify group admin about new membership request. |
bp-groups/bp-groups-notifications.php: groups_notification_membership_request_completed() |
Notify member about their group membership request. |
bp-groups/bp-groups-notifications.php: groups_notification_promoted_member() |
Notify group member they have been promoted. |
bp-groups/bp-groups-notifications.php: groups_format_notifications() |
Format notifications for the Groups component. |
bp-integrations/learndash/library/SyncGenerator.php: SyncGenerator::createLearndashGroup() |
Greate a ld group based on current bp group |
bp-integrations/learndash/library/SyncGenerator.php: SyncGenerator::verifyInputs() |
Verify the givent group ids still exists in db |
bp-integrations/learndash/library/SyncGenerator.php: SyncGenerator::associateToBuddypress() |
Associate current ld group to bp group |
bp-integrations/learndash/buddypress/Ajax.php: Ajax::setRequestGroups() |
Setup the current bp and ld groups on ajax request |
bp-integrations/learndash/learndash/Admin.php: Admin::asyncMetaboxHtml() |
Output group sync metabox html |
bp-templates/bp-nouveau/includes/activity/ajax.php: bp_nouveau_ajax_post_update() |
Processes Activity updates received via a POST request. |
bp-templates/bp-nouveau/includes/media/ajax.php: bp_nouveau_ajax_media_album_save() |
Save album |
bp-templates/bp-nouveau/includes/media/ajax.php: bp_nouveau_ajax_media_album_delete() |
Delete album |
bp-templates/bp-nouveau/includes/messages/ajax.php: bp_nouveau_ajax_get_user_message_threads() |
AJAX get all user message threads. |
bp-templates/bp-nouveau/includes/groups/classes.php: BP_Nouveau_Customizer_Group_Nav::__construct() |
Constructor |
bp-templates/bp-nouveau/includes/groups/ajax.php: bp_nouveau_ajax_joinleave_group() |
Join or leave a group when clicking the “join/leave” button via a POST request. |
bp-templates/bp-nouveau/includes/template-tags.php: bp_nouveau_get_customizer_link() |
Get a link to reach a specific section into the customizer |
bp-core/bp-core-tools-default-data.php: bp_dd_import_forums_in_groups() |
Import Forums in Groups |
bp-core/classes/class-bp-email-tokens.php: BP_Email_Tokens::token__group_card_small() |
Generate the output for token group.small_card |
bp-core/classes/class-bp-email-tokens.php: BP_Email_Tokens::token__group_card() |
Generate the output for token group.card |
bp-core/classes/class-bp-email-tokens.php: BP_Email_Tokens::token__group_description() |
Generate the output for token group.description |
bp-core/gdpr/class-bp-group-membership-export.php: BP_Group_Membership_Export::process_data() |
Export member group memberships. |
bp-core/bp-core-attachments.php: bp_attachments_cover_image_ajax_upload() |
Ajax Upload and set a cover photo |
bp-core/bp-core-avatars.php: bp_avatar_ajax_upload() |
Ajax upload an avatar. |
bp-core/bp-core-avatars.php: bp_core_fetch_avatar() |
Get an avatar for a BuddyPress object. |
bp-activity/bp-activity-functions.php: bp_activity_user_can_read() |
Can a user see a particular activity item? |
bp-activity/screens/permalink.php: bp_activity_action_permalink_router() |
Catch and route requests for single activity item permalinks. |
bp-activity/bp-activity-template.php: bp_get_activity_secondary_avatar() |
Return the avatar of the object that action was performed on. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.