Skip to content

fix(admin): move form handling to admin_init to fix white screen on save#3

Open
ke-ma-fi wants to merge 1 commit into
JeremieSamson:mainfrom
ke-ma-fi:fix/admin-form-redirect
Open

fix(admin): move form handling to admin_init to fix white screen on save#3
ke-ma-fi wants to merge 1 commit into
JeremieSamson:mainfrom
ke-ma-fi:fix/admin-form-redirect

Conversation

@ke-ma-fi

@ke-ma-fi ke-ma-fi commented Jun 8, 2026

Copy link
Copy Markdown

Form submissions were processed inside render_page(), which runs after WordPress has already sent the admin HTML headers. wp_safe_redirect() silently failed, then exit cut the page short mid-HTML.

Form submissions were processed inside render_page(), which runs after
WordPress has already sent the admin HTML headers. wp_safe_redirect()
silently failed, then exit cut the page short mid-HTML.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 8, 2026 05:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Moves admin form submission handling out of page rendering and into the standard WordPress admin lifecycle so actions are processed earlier and more consistently.

Changes:

  • Hooks handle_form_submit() to admin_init instead of calling it during render_page()
  • Updates handle_form_submit() visibility to public to allow WordPress to invoke it as an action callback

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public function __construct()
{
add_action('admin_menu', [$this, 'add_menu']);
add_action('admin_init', [$this, 'handle_form_submit']);
}

private function handle_form_submit(): void
public function handle_form_submit(): void
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants