nicholas-wordpress / core
Nearly-headless application support for WordPress themes
Installs: 292
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 4
Type:project
Requires
- underpin/meta-loader: ^1.1
- underpin/option-loader: ^1.1
- underpin/rest-endpoint-loader: ^1.1
- underpin/script-loader: ^1.2
- underpin/template-loader: ^1.2
- underpin/underpin: ^2.0
Requires (Dev)
This package is auto-updated.
Last update: 2024-10-27 15:43:45 UTC
README
This module sets up the back-end logic necessary to use, and extend a nearly headless WordPress website.
Boilerplate
This module is used in a theme boilerplate. You probably want to use that directly.
Installation
composer require nicholas-wordpress/core
Extending
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
Scripts
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.
REST Endpoints
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.