wporg-developer

WordPress.org Developer theme

63
41
63
77
PHP
public

Developer.WordPress.org Theme

Development

Prerequisites

  • Docker
  • Node/npm
  • Yarn
  • Composer

Setup

  1. Set up repo dependencies.

    yarn setup:tools
    
  2. Build the assets. If there’s anything that needs setting up.

    yarn build
    
  3. Start the local environment.

    yarn wp-env start
    
  4. Run the setup script.

    yarn setup
    
  5. Visit site at localhost:8888.

  6. Log in with username admin and password password.

WordPress Playground

To run the environment without Docker, use WordPress Playground:

yarn playground

The Playground setup mounts the same WordPress.org sandbox bootstrap used by wp-env, activates the local plugins and theme, and creates the starter pages.

The playground:import-docs command starts Playground after importing the manifest and Markdown content for a documentation post type. For example, to import the Playground documentation, run:

IMPORT_POST_TYPE=playground yarn playground:import-docs

Environment management

These must be run in the project’s root folder, not in theme/plugin subfolders.

  • Stop the environment.

    yarn wp-env stop
    
  • Restart the environment.

    yarn wp-env start
    
  • Open a shell inside the docker container.

    yarn wp-env run wordpress bash
    
  • Run wp-cli commands. Keep the wp-cli command in quotes so that the flags are passed correctly.

    yarn wp-env run cli "post list --post_status=publish"
    
  • Update composer dependencies and sync any repo-tools changes.

    yarn update:tools
    
  • Watch for SCSS changes and rebuild the CSS as needed.

    yarn start:theme
    
  • Parse the code reference again. This is run as part of the project setup.

    yarn parse
    

Asset management

  • Build assets once: yarn build:theme
  • Watch assets and build on changes: yarn start:theme
v0.3.3[beta]