### Start WordPress Development Environment Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Install dependencies, build development assets, start the environment, and install WordPress. Access your site at http://localhost:8889. ```bash npm install npm run build:dev npm run env:start npm run env:install ``` -------------------------------- ### Start Development Environment Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Start the development environment. This is the primary command to bring the environment online. ```bash npm run env:start ``` -------------------------------- ### Example WP-CLI Help Command Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md An example of how to run the 'help' command using the WP-CLI wrapper script. ```bash npm run env:cli -- help ``` -------------------------------- ### Install Node.js on Ubuntu Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Use apt to install Node.js and npm on Ubuntu. Ensure Node.js version 20.x and npm version 10.x are installed. ```bash apt install nodejs npm ``` -------------------------------- ### Install Node.js on Windows Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Use Chocolatey to install Node.js on Windows. Ensure Node.js version 20.x and npm version 10.x are installed. ```bash choco install nodejs ``` -------------------------------- ### Install from Branch Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tools/php-ai-client/README.md Use this command to install the AI client from a specific branch. Ensure you are in the WordPress development repository root. ```bash bash tools/php-ai-client/installer.sh --branch=main ``` -------------------------------- ### Install Node.js Dependencies Source: https://github.com/wordpress/wordpress-develop/blob/trunk/src/wp-content/themes/twentynineteen/contributing.txt Installs all Node.js dependencies required for theme development. Run this command in the theme directory. ```bash npm install ``` -------------------------------- ### Install Node.js on macOS Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Use Homebrew to install Node.js on macOS. Ensure Node.js version 20.x and npm version 10.x are installed. ```bash brew install node ``` -------------------------------- ### Basic Test Structure Example Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/phpunit/data/html5lib-tests/tree-construction/README.md Illustrates the fundamental structure of a tree construction test file, including sections for data, errors, and the resulting DOM. ```text #data

One

Two #errors 3: Missing document type declaration #document | | | |

| "One" |

| "Two" ``` -------------------------------- ### Install Specific Release Version Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tools/php-ai-client/README.md Use this command to install a specific release version of the AI client. Ensure you are in the WordPress development repository root. ```bash bash tools/php-ai-client/installer.sh --version=1.0.0 ``` -------------------------------- ### Lint Workflow Files with Actionlint Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Run Actionlint to statically scan GitHub Actions workflow files for quality and security standards. Ensure Actionlint is installed locally. ```bash actionlint ``` -------------------------------- ### Lint Workflow Files with Zizmor Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Run Zizmor to statically scan all workflow files in the current directory for quality and security standards. Ensure Zizmor is installed locally. Zizmor issues are reported via status checks, not workflow run failures. ```bash zizmor . ``` -------------------------------- ### Watch for File Changes Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Start the file watcher to automatically build or copy core files as they are modified. Press Ctrl+C to stop. ```bash npm run dev ``` -------------------------------- ### Run a Single E2E Test File Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/e2e/README.md Execute a specific E2E test file. Provide the path to the test file after the command. ```bash npm run test:e2e tests/e2e/specs/hello.test.js ``` -------------------------------- ### Run PHPStan with Increased Memory Limit via Composer Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/phpstan/README.md Increase the memory limit for PHPStan analysis when running via Composer. Example shows setting to 4G. ```bash composer run phpstan -- --memory-limit=4G ``` -------------------------------- ### Gallery Link To Options Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/qunit/index.html Configures where gallery images link to. Options include Attachment Page, Media File, or None. ```html

Gallery Settings

``` -------------------------------- ### App Icon Preview Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/qunit/index.html Displays a preview of an image as an app icon. ```html
Preview as an app icon
``` -------------------------------- ### Run PHPStan with Increased Memory Limit via npm Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/phpstan/README.md Increase the memory limit for PHPStan analysis when running via npm. Example shows setting to 4G. ```bash npm run typecheck:php -- --memory-limit=4G ``` -------------------------------- ### Using Genericons CSS Source: https://github.com/wordpress/wordpress-develop/blob/trunk/src/wp-content/themes/twentyfifteen/genericons/README.md This snippet demonstrates how to use Genericons by defining a CSS class to display an icon. Ensure the 'font' folder is in your stylesheet directory and 'genericons.css' is enqueued. ```css .my-icon:before { content: '\f101'; font: normal 16px/1 'Genericons'; display: inline-block; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } ``` -------------------------------- ### Generate Code Coverage Report Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Generate code coverage reports in HTML, PHP, and text formats. Requires xDebug to be installed and enabled. This command saves reports to the 'coverage' folder. ```bash npm run test:coverage ``` -------------------------------- ### Configure Preload Setting Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/qunit/index.html Renders a preload setting with buttons for 'Auto', 'Metadata', and 'None' options. ```html
Preload
``` -------------------------------- ### Run PHP Unit Tests with Filter Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Run the PHP test suite and filter tests by a specific name. Use `--filter` followed by the test name. ```bash npm run test:php -- --filter ``` -------------------------------- ### Run E2E Tests (Custom Environment) Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/e2e/README.md Run E2E tests with a custom environment URL, username, and password. Set WP_BASE_URL, WP_USERNAME, and WP_PASSWORD environment variables. ```bash WP_BASE_URL=http://mycustomurl WP_USERNAME=username WP_PASSWORD=password npm run test:e2e ``` -------------------------------- ### Clone WordPress Repository using GitHub CLI Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Fork and clone the WordPress develop repository using the GitHub CLI. This command also sets up the upstream remote. ```bash gh repo fork WordPress/wordpress-develop --clone --remote ``` -------------------------------- ### Run End-to-End Tests Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Execute the end-to-end test suite for the WordPress development environment. ```bash npm run test:e2e ``` -------------------------------- ### Manage Video Tracks (Subtitles, Captions) Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/qunit/index.html Manages video tracks such as subtitles, captions, descriptions, chapters, or metadata. Displays existing tracks or a message if none are present. ```html ``` -------------------------------- ### WordPress Link To Options Source: https://github.com/wordpress/wordpress-develop/blob/trunk/tests/qunit/index.html Configures the link destination for media attachments, including custom URLs. ```html ``` -------------------------------- ### Run PHP Unit Tests Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Execute the PHP test suite. You can filter tests by name or group using additional parameters. ```bash npm run test:php ``` -------------------------------- ### Reset Development Environment Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Reset the development environment by destroying the database and attempting to remove pulled container images. Use with caution as this action is destructive. ```bash npm run env:reset ``` -------------------------------- ### Run WP-CLI Command Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Execute WP-CLI commands within the development environment. Replace `` with the desired WP-CLI command. ```bash npm run env:cli -- ``` -------------------------------- ### Run PHP Unit Tests with Group Source: https://github.com/wordpress/wordpress-develop/blob/trunk/README.md Run the PHP test suite and filter tests by a specific group or ticket number. Use `--group` followed by the group name. ```bash npm run test:php -- --group ```