BP_Settings_Component:: setup_admin_bar (数组wp_admin_nav美元=数组())
设置工具栏。
描述
参数
- wp_admin_nav美元
-
(数组)(可选)管理栏项目的数组。
默认值:数组()
源
文件:bp-settings /类/ class-bp-settings-component.php
public function setup_admin_bar($wp_admin_nav = array()){//登录用户菜单if (is_user_logged_in()){//设置登录的用户变量。$settings_link = trailingslashit(bp_loggedin_user_domain()。bp_get_settings_slug ());//添加主设置菜单。$wp_admin_nav[] = array('parent' => buddypress()->my_account_menu_id, 'id' => 'my-account-') .使用实例$ this - > id、标题 ' => __( ' 账户”、“buddyboss”),“href”= > $ settings_link);/ /一般帐户。美元wp_admin_nav[] =数组(“父”= >“我的账户-”。$this->id, 'id' => 'my-account-'。 $this->id . '-general', 'title' => __( 'Login Information', 'buddyboss' ), 'href' => $settings_link, 'position' => 10 ); // Notifications - only add the tab when there is something to display there. if ( has_action( 'bp_notification_settings' ) ) { $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-notifications', 'title' => __( 'Email Preferences', 'buddyboss' ), 'href' => trailingslashit( $settings_link . 'notifications' ), 'position' => 20 ); } $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-export', 'title' => __( 'Export Data', 'buddyboss' ), 'href' => trailingslashit( $settings_link . 'export/' ), 'position' => 50 ); // Delete Account if ( !bp_current_user_can( 'bp_moderate' ) && ! bp_core_get_root_option( 'bp-disable-account-deletion' ) ) { $wp_admin_nav[] = array( 'parent' => 'my-account-' . $this->id, 'id' => 'my-account-' . $this->id . '-delete-account', 'title' => __( 'Delete Account', 'buddyboss' ), 'href' => trailingslashit( $settings_link . 'delete-account' ), 'position' => 90 ); } } parent::setup_admin_bar( $wp_admin_nav ); }
更新日志
版本 | 描述 |
---|---|
BuddyPress 1.5.0 | 介绍了。 |