I am not able to update the group status
-
I have created a new group with the below code.
// Define the group details. $group_args = array( 'creator_id' => get_current_user_id(), // The ID of the user who creates the group. 'name' => 'My New Group', // Replace this with the desired group name. 'description' => 'This is a sample group created by code.', // Replace this with the group description. 'status' => 'public', // You can set the status to 'public', 'private', or 'hidden'. ); // Create the group. $group_id = groups_create_group( $group_args ); if ( ! is_wp_error( $group_id ) ) { echo 'Group created successfully. Group ID: ' . $group_id; } else { echo 'Failed to create group: ' . $group_id->get_error_message(); }
I want to update the created group status from “public” to “hidden” but I cannot find the proper hook/function.
- You must be logged in to reply to this topic.