BP_Admin::site_admin_menus()

Register site-admin nav menu elements.

Description

Source

File: bp-core/classes/class-bp-admin.php

636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
public function site_admin_menus() {
    if ( ! bp_current_user_can( 'manage_options' ) ) {
        return;
    }
 
    $hooks = array();
 
    // Appearance > Emails.
    $hooks[] = add_theme_page(
        __( 'Emails', 'buddyboss' ),
        __( 'Emails', 'buddyboss' ),
        $this->capability,
        'bp-emails-customizer-redirect',
        'bp_email_redirect_to_customizer'
    );
 
    if ( is_network_admin() && bp_is_network_activated() ) {
        $email_url = get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() );
    } else {
        $email_url = 'edit.php?post_type=' . bp_get_email_post_type();
    }
 
    $hooks[] = add_submenu_page(
        'buddyboss-platform',
        __( 'Emails', 'buddyboss' ),
        __( 'Emails', 'buddyboss' ),
        'bp_moderate',
        $email_url,
        ''
    );
 
    foreach( $hooks as $hook ) {
        add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' );
    }
}

Changelog

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