-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Directorist version
Latest
Environment
Latest
Description
When clicking the "Go to Settings" button from Builder β All Listing Layout (used to enable/disable Grid, List, or Map views), the button redirects to General Settings instead of the All Listings settings page.
As a result, users cannot manage Grid, List, and Map view options from the intended settings screen.
Additionally, this issue causes a 404 or Invalid Redirect on websites installed in a subdirectory, as the generated URL strips the subdirectory path.
Expected Behavior
The button should redirect directly to the All Listings settings page inside the correct WordPress installation path.
Expected URL Pattern:
https://your-site.com/wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-settings#listing_settings__listings_page
Actual Behavior
1. Wrong Settings Page
The button redirects to the generic General Settings page rather than the specific All Listings configuration tab.
2. Subdirectory Stripping
The button generates a URL that ignores the subdirectory, leading to a broken link or the root site's admin panel.
Example Setup:
https://sovqa.site/directorist-development/
Correct Settings URL (Target):
https://sovqa.site/directorist-development/wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-directory-types&listing_type_id=3&action=edit
Current Incorrect URL (Generated by Button):
https://sovqa.site/wp-admin/edit.php?post_type=at_biz_dir&page=atbdp-settings
(Note: The /directorist-development/ segment is completely missing).
Possible Root Cause
The button appears to be using a hard-coded or incorrectly generated absolute URL mechanism, failing to utilize WordPress dynamic path functions.
Suggested Fix
- Dynamic Generation: Use
admin_url('edit.php?post_type=at_biz_dir&page=atbdp-settings...')to automatically handle subdirectories/subdomains. - Targeting: Ensure the link includes the correct anchor or query parameter to land specifically on the All Listings tab.
Steps to Reproduce
- Go to Builder.
- Open All Listing Layout.
- Click "Go to Settings".
Isolating the problem
- I have reproduced this bug in localhost.
- This bug happens with a default WordPress theme active (eg. 2021, 2022 etc).