Skip to:
Content

BuddyPress.org

Changeset 14178


Ignore:
Timestamp:
12/27/2025 01:40:05 AM (3 months 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.

Developed at https://github.com/buddypress/buddypress/pull/414/

Props joelkarunungan, nikunj8866, and vapvarun.

See #9297 (14.0)

File:
1 edited

Legend:

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

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