This module sets up the back-end logic necessary to use, and extend a nearly headless WordPress website.
This module is used in a theme boilerplate. You probably want to use that directly.
composer require nicholas-wordpress/core
This is an Underpin module, and the entrypoint for it is using the function
nicholas
, and it comes built-in with a handful of loaders:
- Script loader
- Rest Endpoint Loader
- Meta Loader
- Option Loader
- Template Loader
- Decision List Loader
This module assumes that your theme has 3 scripts built-into the build
directory of your theme:
- admin.js - Gets enqueued in the settings screen located in Settings>>>Nicholas Settings
- editor.js - Gets enqueued on block editor pages
- theme.js - Gets enqueued on front-end pages that are not using compatibility mode
- sessionManager.js - Forces a session to clear the cache if the
nicholas_flush_cache
cookie is set.
This module loads in a set of endpoints in the nicholas/v1
namespace. These endpoints are used by the various scripts
mentioned above to run the nearly-headless paradigm.