BP_Admin: admin_menus ()

注册网站或网络管理导航菜单元素。

描述

根据当前配置上下文连接到站点或网络管理员。

文件:bp-core /类/ class-bp-admin.php

Public function admin_menus() {global $menu;//如果用户不能调节,则退出。如果(!Bp_current_user_can ('manage_options')) {return;$ Menu [] = array(", 'read', 'separator- BuddyBoss ', ' word - Menu -separator '); //添加菜单分隔符// WPCS: override ok。$menu[] = array(", 'read', 'separator-plugins', ", 'wp-menu-separator -plugins');// WPCS: override ok。} $hooks = array();//在BP 1.6中改变。 See bp_core_admin_backpat_menu(). $hooks[] = add_menu_page( __( 'BuddyBoss', 'buddyboss' ), __( 'BuddyBoss', 'buddyboss' ), $this->capability, $this->settings_page, 'bp_core_admin_backpat_menu', buddypress()->plugin_url . 'bp-core/images/admin/icons/logos/buddyboss.svg', 62 ); $hooks[] = add_submenu_page( 'bp-general-settings', __( 'BuddyBoss Help', 'buddyboss' ), __( 'Help', 'buddyboss' ), $this->capability, 'bp-general-settings', 'bp_core_admin_backpat_page' ); // Add the Separator. // $hooks[] = add_submenu_page( // $this->settings_page, // __( '', 'buddyboss' ), // __( '', 'buddyboss' ), // $this->capability, // 'bp-plugin-separator-notice', // '' // ); // Add the option pages. $hooks[] = add_submenu_page( $this->settings_page, __( 'BuddyBoss Components', 'buddyboss' ), __( 'Components', 'buddyboss' ), $this->capability, 'bp-components', 'bp_core_admin_components_settings' ); $hooks[] = add_submenu_page( $this->settings_page, __( 'Pages', 'buddyboss' ), __( 'Pages', 'buddyboss' ), $this->capability, 'bp-pages', 'bp_core_admin_pages_settings' ); $hooks[] = add_submenu_page( $this->settings_page, __( 'BuddyBoss Settings', 'buddyboss' ), __( 'Settings', 'buddyboss' ), $this->capability, 'bp-settings', 'bp_core_admin_settings' ); $hooks[] = add_submenu_page( $this->settings_page, __( 'Plugin Integrations', 'buddyboss' ), __( 'Integrations', 'buddyboss' ), $this->capability, 'bp-integrations', 'bp_core_admin_integrations' ); // Credits. $hooks[] = add_submenu_page( $this->settings_page, __( 'Credits', 'buddyboss' ), __( 'Credits', 'buddyboss' ), $this->capability, 'bp-credits', array( $this, 'bp_credits_screen' ) ); // For consistency with non-Multisite, we add a Tools menu in // the Network Admin as a home for our Tools panel. if ( is_multisite() && bp_core_do_network_admin() ) { $tools_parent = 'network-tools'; $hooks[] = add_menu_page( __( 'Tools', 'buddyboss' ), __( 'Tools', 'buddyboss' ), $this->capability, $tools_parent, 'bp_core_tools_top_level_item', '', 24 // Just above Settings. ); $hooks[] = add_submenu_page( $tools_parent, __( 'Available Tools', 'buddyboss' ), __( 'Available Tools', 'buddyboss' ), $this->capability, 'available-tools', 'bp_core_admin_available_tools_page' ); } else { $tools_parent = 'tools.php'; } $hooks[] = add_submenu_page( $this->settings_page, __( 'Tools', 'buddyboss' ), __( 'Tools', 'buddyboss' ), $this->capability, 'bp-tools', 'bp_core_admin_tools' ); $hooks[] = add_submenu_page( $this->settings_page, __( 'Help', 'buddyboss' ), __( 'Help', 'buddyboss' ), $this->capability, 'bp-help', 'bp_core_admin_help' ); $hooks[] = add_submenu_page( $this->settings_page, __( '', 'buddyboss' ), __( '', 'buddyboss' ), $this->capability, 'bp-plugin-separator-notice', '' ); // For network-wide configs, add a link to (the root site's) Emails screen. if ( is_network_admin() && bp_is_network_activated() ) { $email_labels = bp_get_email_post_type_labels(); $email_url = get_admin_url( bp_get_root_blog_id(), 'edit.php?post_type=' . bp_get_email_post_type() ); $hooks[] = add_menu_page( $email_labels['name'], $email_labels['menu_name'], $this->capability, '', '', 'dashicons-email-alt', 26 ); // Hack: change the link to point to the root site's admin, not the network admin. //$GLOBALS['menu'][26][2] = esc_url_raw( $email_url ); } // foreach( $hooks as $hook ) { // add_action( "admin_head-$hook", 'bp_core_modify_admin_menu_highlight' ); // } }

更新日志

更新日志
版本 描述
BuddyPress 1.6.0 介绍了。

问题吗?

我们总是很乐意帮助您解决代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队