bp_activity_admin_menu()
Add the Activity top-level menu link when viewing single activity item.
Description
Return
(null) Null if user does not have access to editing functionality.
Source
File: bp-activity/bp-activity-adminbar.php
function bp_activity_admin_menu() { global $wp_admin_bar; // Only show if viewing a single activity item. if ( ! bp_is_single_activity() ) { return; } // Only show this menu to super admins if ( ! bp_current_user_can( 'bp_moderate' ) ) { return; } $activity_edit_link = add_query_arg( array( 'page' => 'bp-activity', 'aid' => bp_current_action(), 'action' => 'edit' ), bp_get_admin_url( 'admin.php' ) ); // Add the top-level Edit Activity button. $wp_admin_bar->add_menu( array( 'id' => 'activity-admin', 'title' => __( 'Edit Activity', 'buddyboss' ), 'href' => esc_url( $activity_edit_link ), ) ); }
Changelog
Version | Description |
---|---|
BuddyPress 2.6.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.