WordPress Plugin Template

Josh's WordPress plugin starter

Documentation
Name
Getting Started
PHP
JavaScript
Local Development
CI/ CD

View the Project on GitHub Shelob9/wordpress-plugin

JavaScript

This plugin uses Yarn workspaces to manage two workspaces. One for components and one for using those components to make WordPress pages.

You need to run all yarn – please do not use npm – commands from the root of the repo.

Component Library Workspace

Source

This workspace is for components. This library is written in TypeScript. It is compiled to JavaScript for use in the WordPress pages.

Most code lives in components. The page entry point will be able to consume these components. Most React code should go here. The pages endpoints should connect those components to WordPress.

Components CLI

All commands for the components library can be run with yarn c <command>. For example:

Components Storybook

Storybook for previewing and documenting components.

WordPress Pages Workspace

WordPress pages that consume the components. These entry points are written in JavaScript/ JSX and are compiled with @wordpress/scripts in a way that is safe for use in wp-admin and front-end and would not work outside of WordPress.

These could be used for blocks or we might need to add a blocks workspace when blocks are a concern.

Pages CLI

All commands for the components library can be run with yarn p <command>. For example: