Skip to content

Commit

Permalink
content hooks need to be registered in time
Browse files Browse the repository at this point in the history
  • Loading branch information
ilicfilip committed Nov 7, 2024
1 parent a4d72b5 commit 4c7504f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions classes/class-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();

Expand All @@ -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();
}
Expand Down

0 comments on commit 4c7504f

Please sign in to comment.