BBP_Forums_Group_Extension::edit_screen( object $group = false )
Show forums and new forum form when editing a group
Description
Parameters
- $group
-
(Optional) (the group to edit if in Group Admin UI)
Default value: false
Source
File: bp-forums/groups.php
public function edit_screen( $group = false ) { $forum_id = 0; $group_id = empty( $group->id ) ? bp_get_new_group_id() : $group->id ; $forum_ids = bbp_get_group_forum_ids( $group_id ); // Get the first forum ID if ( !empty( $forum_ids ) ) { $forum_id = (int) is_array( $forum_ids ) ? $forum_ids[0] : $forum_ids; } // Should box be checked already? $checked = is_admin() ? bp_group_is_forum_enabled( $group ) : bp_get_new_group_enable_forum() || bp_group_is_forum_enabled( bp_get_group_id() ); ?> <h4><?php esc_html_e( 'Group Forum Settings', 'buddyboss' ); ?></h4> <fieldset> <legend class="screen-reader-text"><?php esc_html_e( 'Group Forum Settings', 'buddyboss' ); ?></legend> <p><?php esc_html_e( 'Create a discussion forum to allow members of this group to communicate in a structured, bulletin-board style fashion.', 'buddyboss' ); ?></p> <div class="field-group"> <p class="checkbox"> <label><input type="checkbox" name="bbp-edit-group-forum" id="bbp-edit-group-forum" value="1"<?php checked( $checked ); ?> /> <?php esc_html_e( 'Yes. I want this group to have a discussion forum.', 'buddyboss' ); ?></label> </p> <p class="description"><?php esc_html_e( 'Saying no will not delete existing forum content.', 'buddyboss' ); ?></p> </div> <?php if ( bbp_is_user_keymaster() ) : ?> <div class="field-group"> <label for="bbp_group_forum_id"><?php esc_html_e( 'Group Forum:', 'buddyboss' ); ?></label> <?php bbp_dropdown( array( 'select_id' => 'bbp_group_forum_id', 'show_none' => __( '(No Forum)', 'buddyboss' ), 'selected' => $forum_id ) ); ?> <p class="description"><?php esc_html_e( 'Only site administrators can reconfigure which forum belongs to this group.', 'buddyboss' ); ?></p> </div> <?php endif; ?> <?php if ( !is_admin() ) : ?> <input type="submit" value="<?php esc_attr_e( 'Save Settings', 'buddyboss' ); ?>" /> <?php endif; ?> </fieldset> <?php // Verify intent if ( is_admin() ) { wp_nonce_field( 'groups_edit_save_' . $this->slug, 'forum_group_admin_ui' ); } else { wp_nonce_field( 'groups_edit_save_' . $this->slug ); } }
Changelog
Version | Description |
---|---|
bbPress (r3563) | Introduced. |
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.