Skip to content

Commit 50b333e

Browse files
committed
Connectors: Fix AI plugin settings page link to use the correct ai-wp-admin slug.
The "Control features in the AI plugin" button on the Options → Connectors screen was linking to `options-general.php?page=ai`, which triggers a "you do not have sufficient permissions" error because the AI plugin now registers its settings page under the slug `ai-wp-admin`. The `AI_PLUGIN_SLUG` constant is still needed as-is for the plugin install call (`saveEntityRecord( 'root', 'plugin', { slug: AI_PLUGIN_SLUG, ... } )`), which must use the wp.org plugin directory slug `ai`. A separate constant, `AI_PLUGIN_PAGE_SLUG`, is introduced for the admin settings page slug and used only at the settings link use-site. Variable naming matches the upstream Gutenberg source-of-truth PR (WordPress/gutenberg#77336), so these built-file changes line up with what core will receive via the next Gutenberg sync. Props dkotter, JeffPaul, nimeshatxecurify, ocean90. Fixes #65073. Made-with: Cursor
1 parent 67094ee commit 50b333e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/wp-includes/build/routes/connectors-home/content.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1349,6 +1349,7 @@ function WpLogoDecoration() {
13491349

13501350
// routes/connectors-home/ai-plugin-callout.tsx
13511351
var AI_PLUGIN_SLUG = "ai";
1352+
var AI_PLUGIN_PAGE_SLUG = "ai-wp-admin";
13521353
var AI_PLUGIN_ID = "ai/ai";
13531354
var AI_PLUGIN_URL = "https://wordpress.org/plugins/ai/";
13541355
var connectorDataValues = Object.values(getConnectorData());
@@ -1527,7 +1528,7 @@ function AiPluginCallout() {
15271528
variant: "secondary",
15281529
size: "compact",
15291530
href: (0, import_url.addQueryArgs)("options-general.php", {
1530-
page: AI_PLUGIN_SLUG
1531+
page: AI_PLUGIN_PAGE_SLUG
15311532
})
15321533
},
15331534
(0, import_i18n3.__)("Control features in the AI plugin")

src/wp-includes/build/routes/connectors-home/content.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)