Reference
wp-config constants
Reference, generated from the plugin source
Constants GCB reads when they are defined, usually in wp-config.php. Found by reading the plugin's defined() checks; the description is the docblock of the code that reads it.
// wp-config.php
define('GCBLITE_COMPONENT_SERVER_URL', 'https://your-frontend.example.com');| Constant | Read in |
|---|---|
GCBLITE_BUILDER_DISABLE_WRITES | includes/RestAPI/BuilderAPI.php:266 |
GCBLITE_COMPONENT_SERVER_URL | includes/Admin/Settings.php:299includes/Assets/EditorAssets.php:87includes/Frontend/Url.php:37 |
GCBLITE_EDITOR_PREVIEW | includes/Blocks/BlockLoader.php:532includes/RestAPI/RenderAPI.php:299 |
GCBLITE_FORCE_COMPONENT_SERVER | includes/RestAPI/RenderAPI.php:257 |
GCBLITE_GOOGLE_MAPS_API_KEY | includes/Integrations/GoogleMapsKey.php:43includes/Integrations/GoogleMapsKey.php:76 |
GCBLITE_LOAD_EXAMPLES | includes/Blocks/BlockLoader.php:315includes/RestAPI/BuilderAPI.php:308 |
GCBLITE_RENDER_SECRET | includes/Admin/Settings.php:364includes/Frontend/Secret.php:48 |
GCBLITE_REVALIDATE_ENABLED | includes/RestAPI/CacheRevalidator.php:147 |
GCBLITE_REVALIDATE_SECRET | includes/RestAPI/CacheRevalidator.php:162 |
GCBLITE_REVALIDATE_URL | includes/RestAPI/CacheRevalidator.php:154 |
GCBLITE_BUILDER_DISABLE_WRITES
Hosts that didn't get a deliberate second switch via GCBLITE_BUILDER_DISABLE_WRITES.
Where it is first read (includes/RestAPI/BuilderAPI.php:266):
if (defined('GCBLITE_BUILDER_DISABLE_WRITES') && GCBLITE_BUILDER_DISABLE_WRITES) {
return new WP_Error(
'gcblite_builder_writes_disabled',
'Builder writes have been disabled on this site via GCBLITE_BUILDER_DISABLE_WRITES.',GCBLITE_COMPONENT_SERVER_URL
GCBLITE_COMPONENT_SERVER_URL constant in wp-config.php.
Where it is first read (includes/Admin/Settings.php:299):
$is_overridden = defined('GCBLITE_COMPONENT_SERVER_URL') || has_filter('gcblite_frontend_url');
?>
<input
type="url"GCBLITE_EDITOR_PREVIEW
Where it is first read (includes/Blocks/BlockLoader.php:532):
|| (defined('GCBLITE_EDITOR_PREVIEW') && GCBLITE_EDITOR_PREVIEW);
// Log for diagnosis regardless.
if (function_exists('error_log')) {GCBLITE_FORCE_COMPONENT_SERVER
Environment override: when the gcblite_force_component_server filter returns true (or the GCBLITE_FORCE_COMPONENT_SERVER constant is truthy) and a frontend URL is configured, skip PHP rendering and route the block through the component server even if render.php exists.
Where it is first read (includes/RestAPI/RenderAPI.php:257):
if (defined('GCBLITE_FORCE_COMPONENT_SERVER') && GCBLITE_FORCE_COMPONENT_SERVER) {
return true;
}
return (bool) apply_filters('gcblite_force_component_server', false);GCBLITE_GOOGLE_MAPS_API_KEY
GCBLITE_GOOGLE_MAPS_API_KEY constant in wp-config.php.
Where it is first read (includes/Integrations/GoogleMapsKey.php:43):
if (defined('GCBLITE_GOOGLE_MAPS_API_KEY') && is_string(GCBLITE_GOOGLE_MAPS_API_KEY)) {
return self::sanitize(GCBLITE_GOOGLE_MAPS_API_KEY);
}
GCBLITE_LOAD_EXAMPLES
The plugin's bundled examples/blocks/ directory, IF GCBLITE_LOAD_EXAMPLES is defined as truthy in wp-config.php.
Where it is first read (includes/Blocks/BlockLoader.php:315):
if (defined('GCBLITE_LOAD_EXAMPLES') && GCBLITE_LOAD_EXAMPLES) {
$example_blocks = GCBLITE_PLUGIN_DIR . 'examples/blocks';
if (is_dir($example_blocks)) {
$dirs = array_merge($dirs, glob($example_blocks . '/*', GLOB_ONLYDIR) ?: []);GCBLITE_RENDER_SECRET
GCBLITE_RENDER_SECRET constant (wp-config.php).
Where it is first read (includes/Admin/Settings.php:364):
$is_overridden = defined('GCBLITE_RENDER_SECRET') || has_filter('gcblite_render_secret');
$resolved = \GCBLite\Frontend\Secret::get();
$masked = $resolved !== ''
? str_repeat('•', max(0, strlen($resolved) - 4)) . substr($resolved, -4)GCBLITE_REVALIDATE_ENABLED
Where it is first read (includes/RestAPI/CacheRevalidator.php:147):
if (defined('GCBLITE_REVALIDATE_ENABLED')) {
return (bool) GCBLITE_REVALIDATE_ENABLED;
}
return (bool) get_option('gcblite_revalidate_enabled', false);GCBLITE_REVALIDATE_SECRET
Where it is first read (includes/RestAPI/CacheRevalidator.php:162):
if (defined('GCBLITE_REVALIDATE_SECRET') && is_string(GCBLITE_REVALIDATE_SECRET) && GCBLITE_REVALIDATE_SECRET !== '') {
return GCBLITE_REVALIDATE_SECRET;
}
$opt = get_option('gcblite_revalidate_secret', '');GCBLITE_REVALIDATE_URL
Where it is first read (includes/RestAPI/CacheRevalidator.php:154):
if (defined('GCBLITE_REVALIDATE_URL') && is_string(GCBLITE_REVALIDATE_URL) && GCBLITE_REVALIDATE_URL !== '') {
return GCBLITE_REVALIDATE_URL;
}
$opt = get_option('gcblite_revalidate_url', '');