function bp_new_group_status() { echo bp_get_new_group_status(); }
?> </li> <li><?php _e('This group will be listed in the groups directory and in search results.', 'vibe'); ?> </li> <li><?php _e('Group content and activity will only be visible to members of the group.', 'vibe'); ?> </li> </ul> </label> <label><input type="radio" name="group-status" value="hidden"<?php if ('hidden' == bp_get_new_group_status()) { ?> checked="checked"<?php } ?> /> <strong><?php _e('This is a hidden group', 'vibe'); ?> </strong> <ul> <li><?php _e('Only users who are invited can join the group.', 'vibe'); ?> </li> <li><?php
/** * Save the Group Forum data on create * * @since bbPress (r3465) */ public function create_screen_save($group_id = 0) { // Nonce check if (!bbp_verify_nonce_request('groups_create_save_' . $this->slug)) { bbp_add_error('bbp_create_group_forum_screen_save', __('<strong>ERROR</strong>: Are you sure you wanted to do that?', 'bbpress')); return; } // Check for possibly empty group_id if (empty($group_id)) { $group_id = bp_get_new_group_id(); } $create_forum = !empty($_POST['bbp-create-group-forum']) ? true : false; $forum_id = 0; $forum_ids = bbp_get_group_forum_ids($group_id); if (!empty($forum_ids)) { $forum_id = (int) is_array($forum_ids) ? $forum_ids[0] : $forum_ids; } // Create a forum, or not switch ($create_forum) { case true: // Bail if initial content was already created if (!empty($forum_id)) { return; } // Set the default forum status switch (bp_get_new_group_status()) { case 'hidden': $status = bbp_get_hidden_status_id(); break; case 'private': $status = bbp_get_private_status_id(); break; case 'public': default: $status = bbp_get_public_status_id(); break; } // Create the initial forum $forum_id = bbp_insert_forum(array('post_parent' => bbp_get_group_forums_root_id(), 'post_title' => bp_get_new_group_name(), 'post_content' => bp_get_new_group_description(), 'post_status' => $status)); // Run the BP-specific functions for new groups $this->new_forum(array('forum_id' => $forum_id)); // Update forum active groups_update_groupmeta(bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id, true); // Toggle forum on $this->toggle_group_forum(bp_get_new_group_id(), true); break; case false: // Forum was created but is now being undone if (!empty($forum_id)) { // Delete the forum wp_delete_post($forum_id, true); // Delete meta values groups_delete_groupmeta(bp_get_new_group_id(), 'forum_id'); groups_delete_groupmeta(bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id); // Toggle forum off $this->toggle_group_forum(bp_get_new_group_id(), false); } break; } }
public function create_screen_save_notab($group_id = 0) { // No nonce check, since there's no tab // Check for possibly empty group_id if (empty($group_id)) { $group_id = bp_get_new_group_id(); } // We always set this true, because we always create a forum (the user doesn't get to choose whether they want it or not anymore) $create_forum = true; //!empty( $_POST['bbp-create-group-forum'] ) ? true : false; $forum_id = 0; $forum_ids = bbp_get_group_forum_ids($group_id); if (!empty($forum_ids)) { $forum_id = (int) is_array($forum_ids) ? $forum_ids[0] : $forum_ids; } // Create a forum, or not switch ($create_forum) { case true: // Bail if initial content was already created if (!empty($forum_id)) { return; } // Set the default forum status switch (bp_get_new_group_status()) { case 'hidden': $status = bbp_get_hidden_status_id(); break; case 'private': $status = bbp_get_private_status_id(); break; case 'public': default: $status = bbp_get_public_status_id(); break; } // Create the initial forum $forum_id = bbp_insert_forum(array('post_parent' => bbp_get_group_forums_root_id(), 'post_title' => bp_get_new_group_name(), 'post_content' => bp_get_new_group_description(), 'post_status' => $status)); // Run the BP-specific functions for new groups $this->new_forum(array('forum_id' => $forum_id)); // Update forum active groups_update_groupmeta(bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id, true); // Toggle forum on $this->toggle_group_forum(bp_get_new_group_id(), true); break; case false: // Forum was created but is now being undone if (!empty($forum_id)) { // Delete the forum wp_delete_post($forum_id, true); // Delete meta values groups_delete_groupmeta(bp_get_new_group_id(), 'forum_id'); groups_delete_groupmeta(bp_get_new_group_id(), '_bbp_forum_enabled_' . $forum_id); // Toggle forum off $this->toggle_group_forum(bp_get_new_group_id(), false); } break; } }
_e('Any site member can join this group.', 'buddypress'); ?> </li> <li><?php _e('This group will be listed in the groups directory and in search results.', 'buddypress'); ?> </li> <li><?php _e('Group content and activity will be visible to any site member.', 'buddypress'); ?> </li> </ul> </label> <label><input type="radio" name="group-status" value="private"<?php if ('private' == bp_get_new_group_status()) { ?> checked="checked"<?php } ?> /> <strong><?php _e('This is a private group', 'buddypress'); ?> </strong> <ul> <li><?php _e('Only users who request membership and are accepted can join the group.', 'buddypress'); ?> </li> <li><?php
/** * Save the Group Forum data on create * * @since bbPress (r3465) */ public function create_screen_save() { check_admin_referer('groups_create_save_' . $this->slug); $create_forum = !empty($_POST['bbp-create-group-forum']) ? true : false; $forum_id = 0; $forum_ids = bbp_get_group_forum_ids(bp_get_new_group_id()); if (!empty($forum_ids)) { $forum_id = (int) is_array($forum_ids) ? $forum_ids[0] : $forum_ids; } // Create a forum, or not switch ($create_forum) { case true: // Bail if initial content was already created if (!empty($forum_id)) { return; } // Set the default forum status switch (bp_get_new_group_status()) { case 'hidden': $status = bbp_get_hidden_status_id(); break; case 'private': $status = bbp_get_private_status_id(); break; case 'public': default: $status = bbp_get_public_status_id(); break; } // Create the initial forum $forum_id = bbp_insert_forum(array('post_parent' => bbp_get_group_forums_root_id(), 'post_title' => bp_get_new_group_name(), 'post_content' => bp_get_new_group_description(), 'post_status' => $status)); // Run the BP-specific functions for new groups $this->new_forum(array('forum_id' => $forum_id)); break; case false: // Forum was created but is now being undone if (!empty($forum_id)) { wp_delete_post($forum_id, true); groups_delete_groupmeta(bp_get_new_group_id(), 'forum_id'); } break; } }