Skip to content

Latest commit

 

History

History
191 lines (184 loc) · 6.59 KB

constants.md

File metadata and controls

191 lines (184 loc) · 6.59 KB

WordPress constants reference

Runtime maps named environment values to WordPress constants before bootstrap. Already-defined constants are preserved. The table reflects the native catalog in ConstantCatalog; older profiles are covered in Compatibility.

Value conversion

Type Meaning
bool Recognized boolean values become booleans; empty/invalid values do not become false automatically.
int Numeric values and booleans are converted to integers.
float Numeric values become floats.
string Scalar text has tags removed and HTML-special characters escaped.
raw-string Scalar text is retained byte-for-byte in the native profile; used for secrets.
int|bool Numeric values become integers; other values use boolean parsing.
string|bool Recognized booleans become booleans; other values use the string conversion.
mod A permission integer or numeric octal string becomes a permission mode.
special A value handled by the WordPress bridge rather than a regular filter.

Custom mappings use SYMPRESS_RUNTIME_ENV_TO_CONST=NAME:TYPE,OTHER:TYPE. Accepted names include bool, int, float, string, raw_string, int_or_bool, string_or_bool and octal_mod. Native aliases are raw-string, int|bool, string|bool and mod.

DB_TABLE_PREFIX controls the PHP table prefix rather than a constant. The bridge removes non-word characters and falls back to wp_ for an empty value. See Environment for file order, process overrides and dumps.

Built-in names

Constant Native type
ABSPATH string
ADMIN_COOKIE_PATH string
ALLOW_SUBDIRECTORY_INSTALL bool
ALLOW_UNFILTERED_UPLOADS bool
ALTERNATE_WP_CRON bool
AUTH_COOKIE string
AUTH_KEY raw-string
AUTH_SALT raw-string
AUTOMATIC_UPDATER_DISABLED bool
AUTOSAVE_INTERVAL int
BACKGROUND_COLOR string
BACKGROUND_IMAGE string
BLOGUPLOADDIR string
BLOG_ID_CURRENT_SITE int
COMPRESS_CSS bool
COMPRESS_SCRIPTS bool
CONCATENATE_SCRIPTS bool
COOKIEHASH string
COOKIEPATH string
COOKIE_DOMAIN string
CORE_UPGRADE_SKIP_NEW_BUNDLED bool
CUSTOM_TAGS string
CUSTOM_USER_META_TABLE string
CUSTOM_USER_TABLE string
DB_CHARSET string
DB_COLLATE string
DB_HOST string
DB_NAME string
DB_PASSWORD raw-string
DB_USER string
DIEONDBERROR bool
DISABLE_WP_CRON bool
DISALLOW_FILE_EDIT bool
DISALLOW_FILE_MODS bool
DISALLOW_UNFILTERED_HTML bool
DOMAIN_CURRENT_SITE string
DO_NOT_UPGRADE_GLOBAL_TABLES bool
EDIT_ANY_USER bool
EMPTY_TRASH_DAYS int
ENFORCE_GZIP bool
ERRORLOGFILE string
FORCE_SSL_ADMIN bool
FORCE_SSL_LOGIN bool
FS_CHMOD_DIR mod
FS_CHMOD_FILE mod
FS_CONNECT_TIMEOUT int
FS_METHOD string
FS_TIMEOUT int
FTP_ASCII int
FTP_AUTOASCII int
FTP_BASE string
FTP_BINARY int
FTP_CONTENT_DIR string
FTP_FORCE bool
FTP_HOST string
FTP_LANG_DIR string
FTP_PASS raw-string
FTP_PLUGIN_DIR string
FTP_PRIKEY string
FTP_PUBKEY string
FTP_SSH bool
FTP_SSL bool
FTP_USER string
HEADER_IMAGE string
HEADER_IMAGE_WIDTH int
HEADER_IMAGE_HEIGHT int
HEADER_TEXTCOLOR string
IMAGE_EDIT_OVERWRITE bool
LANGDIR string
LOGGED_IN_COOKIE string
LOGGED_IN_KEY raw-string
LOGGED_IN_SALT raw-string
MEDIA_TRASH bool
MULTISITE bool
MUPLUGINDIR string
MU_BASE string
MYSQL_CLIENT_FLAGS int
MYSQL_NEW_LINK bool
NOBLOGREDIRECT string
NONCE_KEY raw-string
NONCE_SALT raw-string
NO_HEADER_TEXT string
PASS_COOKIE string
PATH_CURRENT_SITE string
PCLZIP_ERROR_EXTERNAL int
PCLZIP_READ_BLOCK_SIZE int
PCLZIP_SEPARATOR string
PCLZIP_TEMPORARY_DIR string
PCLZIP_TEMPORARY_FILE_RATIO float
PLUGINS_COOKIE_PATH string
POST_BY_EMAIL bool
PO_MAX_LINE_LEN int
PRIMARY_NETWORK_ID int
RECOVERY_MODE_COOKIE string
RECOVERY_MODE_EMAIL string
SAVEQUERIES bool
SCRIPT_DEBUG bool
SECRET_KEY raw-string
SECRET_SALT raw-string
SECURE_AUTH_COOKIE string
SECURE_AUTH_KEY raw-string
SECURE_AUTH_SALT raw-string
SHORTINIT bool
SITECOOKIEPATH string
SITE_ID_CURRENT_SITE int
SUBDOMAIN_INSTALL bool
SUNRISE special
TEST_COOKIE string
UPLOADBLOGSDIR string
UPLOADS string
USER_COOKIE string
VHOST string
WP_ACCESSIBLE_HOSTS string
WP_ALLOW_MULTISITE bool
WP_ALLOW_REPAIR bool
WP_AUTO_UPDATE_CORE string|bool
WP_CACHE bool
WP_CONTENT_DIR string
WP_CONTENT_URL string
WP_CRON_LOCK_TIMEOUT int
WP_DEBUG bool
WP_DEBUG_DISPLAY bool
WP_DEBUG_LOG string|bool
WP_DEFAULT_THEME string
WP_DEVELOPMENT_MODE string
WP_DISABLE_FATAL_ERROR_HANDLER bool
WP_FEATURE_BETTER_PASSWORDS bool
WP_HOME string
WP_HTTP_BLOCK_EXTERNAL bool
WP_JSON_SERIALIZE_COMPATIBLE bool
WP_LANG_DIR string
WP_LOAD_IMPORTERS bool
WP_LOCAL_DEV bool
WP_MAIL_INTERVAL int
WP_MAX_MEMORY_LIMIT string
WP_MEMORY_LIMIT string
WP_PLUGIN_DIR string
WP_PLUGIN_URL string
WP_POST_REVISIONS int|bool
WP_PROXY_BYPASS_HOSTS string
WP_PROXY_HOST string
WP_PROXY_PASSWORD raw-string
WP_PROXY_PORT int
WP_PROXY_USERNAME string
WP_SITEURL string
WP_TEMP_DIR string
WP_TEMPLATE_PART_AREA_FOOTER string
WP_TEMPLATE_PART_AREA_HEADER string
WP_TEMPLATE_PART_AREA_SIDEBAR string
WP_TEMPLATE_PART_AREA_UNCATEGORIZED string
WP_USE_EXT_MYSQL bool
WP_USE_THEMES bool
WPLANG string
WPMU_ACCEL_REDIRECT bool
WPMU_PLUGIN_DIR string
WPMU_PLUGIN_URL string
WPMU_SENDFILE bool