Opened 5 months ago
Closed 3 days ago
#9297 closed defect (bug) (fixed)
"Profile Visibility" settings link causes 404 when Extended Profiles is disabled
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 14.5.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Settings | Keywords: | has-patch needs-testing |
| Cc: |
Description
After disabling the Extended Profiles component (via wp-admin ā Settings ā BuddyPress ā Components), the "Profile Visibility" link still appears under the user settings navigation (e.g., /members/username/settings/profile/).
Since Extended Profiles is disabled, clicking this link results in a 404 error.
Expected behavior:
The "Profile Visibility" tab should be automatically removed when the Extended Profiles (xprofile) component is not active, as it depends on that module to function.
Current workaround:
Iām using the following code to manually remove the nav item:
add_action( 'bp_actions', function() {
bp_core_remove_subnav_item( 'settings', 'profile', 'members' );
}, 99 );
It would be great if BuddyPress could automatically hide this settings tab when the associated component is disabled, to avoid broken links and improve UX.
Change History (7)
This ticket was mentioned in āPR #414 on ābuddypress/buddypress by ā@nikunj8866.
5 months ago
#1
- Keywords has-patch added
#4
@
6 days ago
- Component changed from Core to Settings
- Milestone changed from Awaiting Review to 14.5.0
I can confirm this. Good catch. The patch looks good. But I'll take another look soon.
#5
@
4 days ago
Tested this locally and can confirm the fix works. With Extended Profiles disabled, the Profile Visibility link no longer appears in Settings nav, and no more 404.
The fix is straightforward - just wrap the subnav registration in bp_is_active( 'xprofile' ). Makes sense since bp_xprofile_screen_settings wouldn't exist without the component anyway.
Thanks @developer06 for the report and @nikunj8866 for the patch!
Trac ticket: āhttps://buddypress.trac.wordpress.org/ticket/9297