Reference
Actions and filters
Reference, generated from the plugin source
Every gcblite_* (and gcb_*) action and filter the plugin fires, found by reading its do_action() and apply_filters() calls. Add to them from a theme or plugin with add_action() / add_filter() as usual.
| Hook | Type | Fired in |
|---|---|---|
gcb_google_maps_api_key | filter | includes/Integrations/GoogleMapsKey.php:58 |
gcblite_block_dirs | filter | includes/Blocks/BlockLoader.php:331 |
gcblite_block_fields | filter | includes/Blocks/BlockLoader.php:609 |
gcblite_block_html | filter | includes/Blocks/BlockLoader.php:520 |
gcblite_brand_marks | filter | includes/Blocks/BrandMarks.php:48 |
gcblite_builder_block_roots | filter | includes/RestAPI/BuilderAPI.php:320 |
gcblite_control_types | filter | includes/Fields/ControlTypes.php:167 |
gcblite_custom_icons | filter | includes/Blocks/KitBlocks.php:309 |
gcblite_editor_preview_html | filter | includes/RestAPI/RenderAPI.php:344 |
gcblite_embed_hosts | filter | includes/Render/embed.php:46 |
gcblite_focus_field_attribute | filter | includes/FocusField/helpers.php:48 |
gcblite_force_component_server | filter | includes/RestAPI/RenderAPI.php:260 |
gcblite_frontend_url | filter | includes/Assets/EditorAssets.php:90includes/Frontend/Url.php:40 |
gcblite_google_maps_api_key | filter | includes/Integrations/GoogleMapsKey.php:48 |
gcblite_icon_sources | filter | includes/Icons/IconSources.php:36 |
gcblite_icon_svg | filter | includes/Render/text.php:110 |
gcblite_kit_dirs | filter | includes/Kit/Registry.php:122 |
gcblite_kit_script_deps | filter | includes/Kit/Registry.php:344 |
gcblite_offered_blocks | filter | includes/Blocks/BlockExamples.php:218 |
gcblite_post_card | filter | includes/Render/card.php:38 |
gcblite_public_user_field_value | filter | includes/User/Registrar.php:178 |
gcblite_query_loop_kit_args | filter | includes/Blocks/Queries/QueryLoop.php:208 |
gcblite_register_control_types | action | includes/Fields/ControlTypes.php:118 |
gcblite_render_secret | filter | includes/Frontend/Secret.php:51 |
gcblite_revalidate_paths | filter | includes/RestAPI/CacheRevalidator.php:95 |
gcblite_settings_after_form | action | includes/Admin/Settings.php:347 |
gcblite_user_is_public | filter | includes/User/Registrar.php:205 |
gcblite_validation_post_types | filter | includes/RestAPI/ValidationAPI.php:48includes/RestAPI/ValidationAPI.php:49 |
gcblite_wp_blocks | filter | includes/Kit/Registry.php:90 |
gcb_google_maps_api_key
Filter. Called as:
apply_filters('gcb_google_maps_api_key', '');Legacy filter — kept for back-compat with any third-party hooks written against the old GCB plugin. The empty-string default matters here: existing call-sites in EditorAssets pass '' as the second arg, so we don't want to short-circuit on the empty default.
gcblite_block_dirs
Filter. Called as:
apply_filters('gcblite_block_dirs', []);Register extra individual block dirs for THIS request. A companion plugin (e.g. Each entry is an absolute path to a single block dir (the folder that holds block.json), NOT a blocks/ root.
- @param array<int,string> $extra_dirs absolute block-dir paths
gcblite_block_fields
Filter. Called as:
apply_filters('gcblite_block_fields', $data, $block_dir);what GCB itself adds to a block's fields (BrandMarks: its marks field, when the block may wear them)
gcblite_block_html
Filter. Called as:
apply_filters('gcblite_block_html', $html, $attributes, $block);what GCB itself adds to every block's output (BrandMarks: its marks), on the page and in the editor's preview
gcblite_brand_marks
Filter. Called as:
apply_filters('gcblite_brand_marks', $list);Fired in: the site's marks, from its theme; [] when it has none
gcblite_builder_block_roots
Filter. Called as:
apply_filters('gcblite_builder_block_roots', []);Register extra block roots (e.g. a draft-workspace theme). Each entry must be ['dir' => '/abs/.../blocks', 'kind' => 'draft', 'editable' => true].
gcblite_control_types
Filter. Called as:
apply_filters('gcblite_control_types', self::$registered);Add field types without calling gcblite_register_control_type(). Same entry shape: type => ['shape' => …, 'doc' => …, 'script' => …]. Entries for built-in types are ignored.
- @param array $registered The types registered so far.
gcblite_custom_icons
Filter. Called as:
apply_filters('gcblite_custom_icons', []);Custom icons for the site's gcb collection.
- @param array $icons name => { label: string, content: svg string, style?: 'line' } 'line' — a stroke icon (stroke="currentColor"-style paths): GCB keeps it a line through the registry (line_icon_svg) and ships its CSS (LINE_ICON_CSS).
gcblite_editor_preview_html
Filter. Called as:
apply_filters('gcblite_editor_preview_html', $html, $block_type->name, $prepared);Fired in: Execute the block's render.php via WP's own render callback.
gcblite_embed_hosts
Filter. Called as:
apply_filters('gcblite_embed_hosts', $hosts);Fired in: The hosts a widget's script may load from. Exact host names, lowercase. Add a provider with add_filter('gcblite_embed_hosts', fn ($h) => array_merge($h, ['widget.example.com']));.
gcblite_focus_field_attribute
Filter. Called as:
apply_filters('gcblite_focus_field_attribute', $default);Fired in: The configured attribute name. Resolution order:
gcblite_force_component_server
Filter. Called as:
apply_filters('gcblite_force_component_server', false);Fired in: Demo / authoring override for render path selection.
gcblite_frontend_url
Filter. Called as:
apply_filters('gcblite_frontend_url', null);Fired in: Resolved frontend URL. Empty string = unconfigured.
gcblite_google_maps_api_key
Filter. Called as:
apply_filters('gcblite_google_maps_api_key', null);New canonical filter first.
gcblite_icon_sources
Filter. Called as:
apply_filters('gcblite_icon_sources', []);Fired in: Every source there is, id → source. WordPress's own first.
gcblite_icon_svg
Filter. Called as:
apply_filters('gcblite_icon_svg', '', $name);Fired in: An icon's drawing. The stored value is {source, name} (or, from older data, a bare name). Then WordPress's own registry — wp_get_icon on 7.1, the registry itself on 7.0, the same two steps gcb-lite's icon-list-item takes — and last the drawing the block was built with.
gcblite_kit_dirs
Filter. Called as:
apply_filters('gcblite_kit_dirs', $roots);Fired in: The kit folders: GCB Lite's, and any a plugin adds — each its plugin's folder and URL (the kit is its kit/, the built modules its build/kit/).
gcblite_kit_script_deps
Filter. Called as:
apply_filters('gcblite_kit_script_deps', [], $part['needs']);Fired in: a part's scripts: its vendor scripts, its own script with the library it needs, its module
gcblite_offered_blocks
Filter. Called as:
apply_filters('gcblite_offered_blocks', null);Fired in: a theme lists the ones that suit it, add_filter('gcblite_offered_blocks', fn () => ['gcb/accordion', 'gcb/tabs', …]); the others are left out of the + list (a page that has one already still shows it). Unfiltered, every one is offered. A block that only lives inside another (a row of an Accordion) goes with its parent. The theme's own blocks are always offered.
gcblite_post_card
Filter. Called as:
apply_filters('gcblite_post_card', null, $post, $args);a site's own card, if it has one
gcblite_public_user_field_value
Filter. Called as:
apply_filters('gcblite_public_user_field_value', $value, $control, $user_id);Fired in: The values anyone may read: get_values() for the controls marked "public": true (or in a group marked so), and no other. The opposite way round from an options page's "private": a person's fields stay theirs unless the theme says a field is for show (gcblite_get_public_user_fields). A field its conditionalLogic hides is left out, a repeater keeps only its public sub-fields when any says, and each value passes through gcblite_public_user_field_value.
gcblite_query_loop_kit_args
Filter. Called as:
apply_filters('gcblite_query_loop_kit_args', [], $post_type, (array) $_GET);Fired in: Read the current page + active filters + fragment flag from the request. render.php calls this so the same template serves the initial server page (full markup) and the REST fragment requests (items + pager only).
gcblite_register_control_types
Action. Called as:
do_action('gcblite_register_control_types');Fired in: Fires on init at priority 4, just before blocks are registered and typed — register field types here:
gcblite_render_secret
Filter. Called as:
apply_filters('gcblite_render_secret', null);gcblite_revalidate_paths
Filter. Called as:
apply_filters('gcblite_revalidate_paths', $paths, $post);Fired in: Compute the paths that need revalidating for this post and POST them to the frontend's revalidate endpoint.
gcblite_settings_after_form
Action. Called as:
do_action('gcblite_settings_after_form');what a settings section cannot hold: a form of its own (the icon uploads, includes/Icons/SiteIcons.php)
gcblite_user_is_public
Filter. Called as:
apply_filters('gcblite_user_is_public', $public, $user_id);Fired in: Is this user shown to whoever asks? Core's rule for its users endpoint (WP_REST_Users_Controller::get_item_permissions_check): a user with published posts in a post type shown in REST is public, any other only to someone who may list or edit users. gcblite_user_is_public changes the rule, e.g. every member of a marketplace public.
gcblite_validation_post_types
Filter. Called as:
apply_filters('gcblite_validation_post_types', [...]);
apply_filters('gcblite_validation_post_types', []);Let CPTs / custom surfaces opt in: apply_filters('gcblite_validation_post_types', [...]).
gcblite_wp_blocks
Filter. Called as:
apply_filters('gcblite_wp_blocks', (bool) get_option('gcblite_wp_blocks', false));Fired in: WORDPRESS'S OWN BLOCKS IN THE KIT'S TOKENS. A list, a quote, a button, a table, a separator… drawn from the site's tokens, so a site written in WordPress's blocks looks like the site. On for a site GCB makes new (npm run site -- new sets the option gcblite_wp_blocks); off for a site that was there before, whose theme already draws them. A theme or a plugin can say otherwise on the gcblite_wp_blocks filter. The same file is the kit's kit/wp-blocks.css in gcb-parts (its check keeps the two the same).