Skip to:
Content

BuddyPress.org

Changeset 14179


Ignore:
Timestamp:
12/27/2025 01:41:19 AM (3 weeks ago)
Author:
espellcaste
Message:

When the Extended Profiles component is disabled, the "Profile Visibility" settings link does not 404.

The "Profile Visibility" link, members/user/settings/profile/, relies on the Extended Profiles component to work properly. When this component is disabled, the link should not added to the user profile settings menu.

We also did the same for the Email link. So that it is added only when the Notifications component is enabled.

Props joelkarunungan, nikunj8866, and vapvarun.

Closes https://github.com/buddypress/buddypress/pull/414/
Fixes #9297 (trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-settings/classes/class-bp-settings-component.php

    r14124 r14179  
    159159        );
    160160
    161         // Add Email nav item. Formerly called 'Notifications', we
    162         // retain the old slug and function names for backward compat.
    163         $sub_nav[] = array(
    164             'name'                     => __( 'Email', 'buddypress' ),
    165             'slug'                     => 'notifications',
    166             'parent_slug'              => $slug,
    167             'screen_function'          => 'bp_settings_screen_notification',
    168             'position'                 => 20,
    169             'user_has_access'          => false,
    170             'user_has_access_callback' => 'bp_core_can_edit_settings',
    171         );
    172 
    173         $sub_nav[] = array(
    174             'name'                     => _x( 'Profile Visibility', 'Profile settings sub nav', 'buddypress' ),
    175             'slug'                     => 'profile',
    176             'parent_slug'              => $slug,
    177             'screen_function'          => 'bp_xprofile_screen_settings',
    178             'position'                 => 30,
    179             'user_has_access'          => false,
    180             'user_has_access_callback' => 'bp_core_can_edit_settings',
    181         );
     161        /**
     162         * Add Email nav item. Formely called 'Notifications', we
     163         * retain the old slug and function names for backward compat.
     164         */
     165        if ( bp_is_active( 'notifications' ) ) {
     166            $sub_nav[] = array(
     167                'name'                     => __( 'Email', 'buddypress' ),
     168                'slug'                     => 'notifications',
     169                'parent_slug'              => $slug,
     170                'screen_function'          => 'bp_settings_screen_notification',
     171                'position'                 => 20,
     172                'user_has_access'          => false,
     173                'user_has_access_callback' => 'bp_core_can_edit_settings',
     174            );
     175        }
     176
     177        if ( bp_is_active( 'xprofile' ) ) {
     178            $sub_nav[] = array(
     179                'name'                     => _x( 'Profile Visibility', 'Profile settings sub nav', 'buddypress' ),
     180                'slug'                     => 'profile',
     181                'parent_slug'              => $slug,
     182                'screen_function'          => 'bp_xprofile_screen_settings',
     183                'position'                 => 30,
     184                'user_has_access'          => false,
     185                'user_has_access_callback' => 'bp_core_can_edit_settings',
     186            );
     187        }
    182188
    183189        $sub_nav[] = array(
Note: See TracChangeset for help on using the changeset viewer.