Documentation navigation
Anybuild documentation

WordPress

Build complete WordPress sites, standalone plugins, and standalone themes.

Detection

Complete sites are detected from the standard WordPress source layout. Anybuild also recognizes standalone plugins from their PHP headers and standalone themes from style.css metadata and theme files. Setting ANYBUILD_WP_VERSION explicitly also selects this provider.

Plugins and themes

Standalone themes and plugins are packaged with WordPress core, assigned a slug from their metadata or directory, and configured with the correct activation target. Complete sites preserve their existing source layout.

Configuration

WordPress inherits all configuration from the PHP provider configuration. Any PHP configuration field or environment variable can also be set for WordPress. The options below are specific to WordPress.

VariablePurposeExample value
ANYBUILD_WP_VERSIONSelect the WordPress version or force provider detection.latest
ANYBUILD_WP_LOCALESet the WordPress locale.en_US
ANYBUILD_WP_CLI_VERSIONSelect the WP-CLI version.2.12.0
ANYBUILD_WP_EXTENSION_KINDSet the extension type to plugin or theme.plugin
ANYBUILD_WP_EXTENSION_SLUGOverride the detected plugin or theme slug.my-plugin
ANYBUILD_WP_EXTENSION_ACTIVATE_TARGETOverride the extension activation target.my-plugin/my-plugin.php

Generated definition

Anybuild
load("//anybuild/tools:wordpress.bzl", "wordpress_build", "wordpress_config", "wordpress_serve")
config = wordpress_config(    schema = 1,    php_version = "8.3.29",)
build = wordpress_build(config)wordpress_serve(config, build, name = "wordpress")