From c9b579fbc7e0960c7517f7f31b8323df1dd32bed Mon Sep 17 00:00:00 2001 From: latenighthackathon Date: Mon, 20 Apr 2026 22:29:08 -0500 Subject: [PATCH] fix[faustwp]: (#1872) use home_url() in handle_generate_endpoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Bedrock-style installs where WordPress core lives under /wp/, site_url('/generate') returns https://example.com/wp/generate but $_SERVER['REQUEST_URI'] is still /generate, so the preg_match in handle_generate_endpoint() never fires and the auth-code redirect silently breaks. home_url() returns the public-facing URL (what REQUEST_URI actually contains), which matches on both standard and Bedrock installs. Per @josephfusco's guidance on #2315, which was closed in favor of this simpler fix — a new filter is not needed, just the correct URL helper. --- .changeset/handle-generate-home-url.md | 5 +++++ plugins/faustwp/includes/auth/callbacks.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/handle-generate-home-url.md diff --git a/.changeset/handle-generate-home-url.md b/.changeset/handle-generate-home-url.md new file mode 100644 index 000000000..c53e9b08e --- /dev/null +++ b/.changeset/handle-generate-home-url.md @@ -0,0 +1,5 @@ +--- +"@faustwp/wordpress-plugin": patch +--- + +fix[faustwp]: use home_url() in handle_generate_endpoint so Bedrock-style installs (where WordPress core lives under /wp/) match against the public REQUEST_URI diff --git a/plugins/faustwp/includes/auth/callbacks.php b/plugins/faustwp/includes/auth/callbacks.php index da82180d0..5d33f7867 100644 --- a/plugins/faustwp/includes/auth/callbacks.php +++ b/plugins/faustwp/includes/auth/callbacks.php @@ -22,7 +22,7 @@ * @return void */ function handle_generate_endpoint() { - $search_pattern = ':^' . site_url( '/generate', 'relative' ) . ':'; + $search_pattern = ':^' . home_url( '/generate', 'relative' ) . ':'; if ( ! preg_match( $search_pattern, $_SERVER['REQUEST_URI'] ) ) { // phpcs:ignore WordPress.Security return;