Add an admin redirect from the old ai page to the new ai-wp-admin page#424
Conversation
…into admin_init and the page denied hook, as the latter seems to fire most often
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #424 +/- ##
=============================================
+ Coverage 68.15% 68.31% +0.16%
- Complexity 808 812 +4
=============================================
Files 53 53
Lines 3925 3939 +14
=============================================
+ Hits 2675 2691 +16
+ Misses 1250 1248 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Jeffrey Paul <[email protected]>
|
Tested this on WordPress Playground and my local. Confirmed the redirect from ?page=ai to ?page=ai-wp-admin is working as expected. ✅ 424-ai-wp-admin-recording.mp4 |
What?
Redirect from the old settings page to the new one:
options-general.php?page=ai->options-general.php?page=ai-wp-adminWhy?
In #340 we switched to a new approach to building our settings page. This required a new page slug,
ai-wp-admin. For anyone still trying to access the old slug ofai, you'll get an access denied error. We probably should have introduced a redirect for that in #340 but better late then never.How?
aiand redirect toai-wp-adminadmin_initandadmin_page_access_denied, as it seems the latter fires most consistentlyUse of AI Tools
Used Cursor running GPT-5.3 Codex to investigate and execute the approach. Tested and refined slightly myself
Testing Instructions
Settings > AI, going to the plugin list screen and clicking Settings under the AI plugin, or manually typing inwp-admin/options-general.php?page=ai-wp-adminwp-admin/options-general.php?page=aiwp-admin/options-general.php?page=ai-wporwp-admin/options-general.php?page=ai-experiments