bp_groups_admin_edit_metabox_group_parent( object $item )

Markup for the single group’s Group Hierarchy metabox.

Description

Parameters

$item

(Required) Information about the current group.

Source

File: bp-groups/bp-groups-admin.php

1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
function bp_groups_admin_edit_metabox_group_parent( $item ) {
 
    $current_parent_group_id = bp_get_parent_group_id( $item->id );
    $possible_parent_groups  = bp_get_possible_parent_groups( $item->id, bp_loggedin_user_id() ); ?>
 
    <div class="bp-groups-settings-section" id="bp-groups-settings-section-group-hierarchy">
        <select id="bp-groups-parent" name="bp-groups-parent" autocomplete="off">
            <option
                value="0" <?php selected( 0, $current_parent_group_id ); ?>><?php _e( 'Select Parent', 'buddyboss' ); ?></option>
            <?php
            if ( $possible_parent_groups ) {
 
                foreach ( $possible_parent_groups as $possible_parent_group ) {
                    ?>
                    <option
                        value="<?php echo $possible_parent_group->id; ?>" <?php selected( $current_parent_group_id, $possible_parent_group->id ); ?>><?php echo esc_html( $possible_parent_group->name ); ?></option>
                    <?php
                }
            }
            ?>
        </select>
    </div>
 
    <?php
}

Changelog

Changelog
Version Description
BuddyPress 1.7.0 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.