bp_core_admin_hook()
Return the action name that BuddyPress nav setup callbacks should be hooked to.
Description Description
Functions used to set up BP Dashboard pages (wrapping such admin-panel functions as add_submenu_page()) should use bp_core_admin_hook() for the first parameter in add_action(). BuddyPress will then determine automatically whether to load the panels in the Network Admin. Ie:
add_action( bp_core_admin_hook(), 'myplugin_dashboard_panel_setup' );
Return Return
(string) $hook The proper hook ('network_admin_menu' or 'admin_menu').
Source Source
File: bp-core/bp-core-functions.php
function bp_core_admin_hook() { $hook = bp_core_do_network_admin() ? 'network_admin_menu' : 'admin_menu'; /** * Filters the action name that BuddyPress nav setup callbacks should be hooked to. * * @since 1.5.0 * * @param string $hook Action name to be attached to. */ return apply_filters( 'bp_core_admin_hook', $hook ); }
Changelog Changelog
Version | Description |
---|---|
1.5.0 | Introduced. |