From 4c7504f7790149199350691b8873c3b1dbad32c5 Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Thu, 7 Nov 2024 15:16:25 +0100 Subject: [PATCH] content hooks need to be registered in time --- classes/class-base.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/class-base.php b/classes/class-base.php index 3296910eb..035268a01 100644 --- a/classes/class-base.php +++ b/classes/class-base.php @@ -51,7 +51,7 @@ public function init() { } // Basic classes. - if ( \is_admin() ) { + if ( \is_admin() || ( defined( 'REST_REQUEST' ) && REST_REQUEST ) ) { if ( \current_user_can( 'publish_posts' ) ) { $this->cached['admin__page'] = new \Progress_Planner\Admin\Page(); @@ -61,7 +61,6 @@ public function init() { } $this->cached['admin__editor'] = new \Progress_Planner\Admin\Editor(); - $this->cached['actions__content'] = new \Progress_Planner\Actions\Content(); $this->cached['actions__content_scan'] = new \Progress_Planner\Actions\Content_Scan(); $this->cached['actions__maintenance'] = new \Progress_Planner\Actions\Maintenance(); @@ -80,6 +79,9 @@ public function init() { $this->cached['suggested_tasks'] = new Suggested_Tasks(); } + // Content actions. + $this->cached['actions__content'] = new \Progress_Planner\Actions\Content(); + // REST API. $this->cached['rest_api'] = new Rest_API(); }