bp_groups_add_admin_menu()

Register the Groups component in BuddyBoss > Groups admin screen.

Description

Source

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

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function bp_groups_add_admin_menu() {
 
    if ( true === bp_disable_group_type_creation() ) {
 
        // Add our screen.
        $hooks[] = add_submenu_page(
            'buddyboss-platform',
            __( 'Groups', 'buddyboss' ),
            __( 'Groups', 'buddyboss' ),
            'bp_moderate',
            'bp-groups',
            'bp_groups_admin'
        );
 
    } else {
        // Add our screen.
        $hooks[] = add_submenu_page(
            'buddyboss-platform',
            __( 'Groups', 'buddyboss' ),
            __( 'Groups', 'buddyboss' ),
            'bp_moderate',
            'bp-groups',
            'bp_groups_admin'
        );
    }
 
    foreach ( $hooks as $hook ) {
        // Hook into early actions to load custom CSS and our init handler.
        add_action( "load-$hook", 'bp_groups_admin_load' );
    }
}

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.