From f2f37314ce9e1094f4b0ebfbe8e0994c55a29512 Mon Sep 17 00:00:00 2001 From: Christopher Ross Date: Tue, 9 Jun 2026 14:16:33 +0000 Subject: [PATCH] fix: use add_action() for ACF options-page submitbox hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit acf/options_page/submitbox_before_major_actions is fired by ACF Pro via do_action(), not apply_filters(). The callback submitbox_before_major_actions echoes output and does not return the $page argument — it is action-shaped, not filter-shaped. Using add_filter() for a do_action() hook works today because WordPress does not error on it, but it is semantically wrong and fragile: if ACF ever switches to apply_filters(), the page object will be lost. The correct registration is add_action(). --- classes/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/admin.php b/classes/admin.php index 634462f..d7a20d0 100644 --- a/classes/admin.php +++ b/classes/admin.php @@ -12,7 +12,7 @@ class Admin { * Register hooks */ protected function init() { - add_filter( + add_action( 'acf/options_page/submitbox_before_major_actions', [ $this,