-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
After banging my head against the wall all day, I think I was able to finally get Nicholas 1.1 working with Underpin 2.0. It does not work out of the box and there appear to be a few show stoppers.
In Nicholas.php
- I think you need the new ::logger
Header seems to require:
use Underpin\Loaders\Logger
Replace the old logger with the new one (not sure if 100% necessary, though was causing errors with other underpin modules like the style loader):
nicholas()->logger()->log_wp_error( 'error', $error, [
// 'ref' => $endpoint,
// 'context' => 'endpoint',
// 'params' => $params,
// ] );
With:
Logger::log_wp_error( 'error', $error, [ 'ref' => $endpoint, 'context' => 'endpoint', 'params' => $params, ] );
- The rest endpoints need to have namespace updated to Rest not Rest_Endpoints:
$this->rest_endpoints()->add( 'page_data', 'Nicholas\**Rest**\Page_Data' ); - Not sure, but perhaps use Underpin\Traits\Feature_Extension needs to be in the heade of Rest_Endpoing.php and/or in Nicholas.php? That seemed missing when testing a standard setup based of your demos on the rest_endpoint GitHub page and was throwing an error without it, though I'm not sure if it's required for Nicholas.
Will see tomorrow if that was it or if more fixes required. Cheers.
Metadata
Metadata
Assignees
Labels
No labels