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.
| Variable | Purpose | Example value |
|---|---|---|
ANYBUILD_WP_VERSION | Select the WordPress version or force provider detection. | latest |
ANYBUILD_WP_LOCALE | Set the WordPress locale. | en_US |
ANYBUILD_WP_CLI_VERSION | Select the WP-CLI version. | 2.12.0 |
ANYBUILD_WP_EXTENSION_KIND | Set the extension type to plugin or theme. | plugin |
ANYBUILD_WP_EXTENSION_SLUG | Override the detected plugin or theme slug. | my-plugin |
ANYBUILD_WP_EXTENSION_ACTIVATE_TARGET | Override the extension activation target. | my-plugin/my-plugin.php |
Generated definition
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")