IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
102 | 102 | |
103 | 103 | // Add Email nav item. Formerly called 'Notifications', we |
104 | 104 | // retain the old slug and function names for backward compat |
105 | | $sub_nav[] = array( |
106 | | 'name' => __( 'Email', 'buddypress' ), |
107 | | 'slug' => 'notifications', |
108 | | 'parent_url' => $settings_link, |
109 | | 'parent_slug' => $this->slug, |
110 | | 'screen_function' => 'bp_settings_screen_notification', |
111 | | 'position' => 20, |
112 | | 'user_has_access' => bp_core_can_edit_settings() |
113 | | ); |
| 105 | if ( $this->is_email_tab_used() ) { |
| 106 | $sub_nav[] = array( |
| 107 | 'name' => __( 'Email', 'buddypress' ), |
| 108 | 'slug' => 'notifications', |
| 109 | 'parent_url' => $settings_link, |
| 110 | 'parent_slug' => $this->slug, |
| 111 | 'screen_function' => 'bp_settings_screen_notification', |
| 112 | 'position' => 20, |
| 113 | 'user_has_access' => bp_core_can_edit_settings() |
| 114 | ); |
| 115 | } |
114 | 116 | |
115 | 117 | // Add Spam Account nav item |
116 | 118 | if ( bp_current_user_can( 'bp_moderate' ) ) { |
… |
… |
|
139 | 141 | } |
140 | 142 | |
141 | 143 | parent::setup_nav( $main_nav, $sub_nav ); |
| 144 | } |
| 145 | |
| 146 | /** |
| 147 | * Decides whether or not to show the email tab |
| 148 | * |
| 149 | * @return bool |
| 150 | */ |
| 151 | public function is_email_tab_used() { |
| 152 | $defaults = array( 'friends', 'forums', 'messages' ); |
| 153 | $components_with_email = apply_filters( 'bp_components_using_email_tab', $defaults ); |
| 154 | foreach ( $components_with_email as $component ) { |
| 155 | if ( bp_is_active( $component ) ) |
| 156 | return true; |
| 157 | } |
| 158 | |
| 159 | return false; |
142 | 160 | } |
143 | 161 | |
144 | 162 | /** |