Skip to content

Commit

Permalink
Function exists check in route registar to prevent fatal in isolation
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher committed Jul 30, 2024
1 parent 0e37501 commit b07dcc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mantle/http/routing/class-rest-route-registrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function register_routes(): void {
* was already fired.
*/
protected function should_register_now(): bool {
return ! ! did_action( 'rest_api_init' );
return function_exists( 'did_action' ) && ! ! did_action( 'rest_api_init' );
}

/**
Expand Down

0 comments on commit b07dcc8

Please sign in to comment.