BlueTheme Docs

Hooks reference

Every action and filter the theme provides, generated from the code (pnpm docs:build). Use them from a child theme's functions.php or a plugin. Paths are inside the bluetheme folder.

Actions

Run your own code at a point: add_action( 'name', $callback, $priority, $accepted_args ).

bluetheme_after_content

No description.

Runs in footer.php:9.

No description.

Runs in footer.php:18.

bluetheme_after_header

No description.

Runs in header.php:27.

bluetheme_before_content

No description.

Runs in header.php:32.

No description.

Runs in footer.php:14.

bluetheme_before_header

No description.

Runs in header.php:23.

bluetheme_booted

Fires after all theme services are registered.

Parameter Type Description
$theme Theme Theme instance.

Runs in inc/Theme.php:73.

bluetheme_builder_enqueued

Fires after a builder post's element assets are queued (templates use it to queue the templates the post embeds).

Parameter Type Description
$post_id int Post id.
$document array Document.

Runs in inc/Builder/Render/Assets.php:120.

bluetheme_builder_setup_post

Fires after the post being edited is set up for rendering (single and archive templates swap in a sample post or query here).

Parameter Type Description
$post WP_Post|null Post.

Runs in inc/Builder/Rest/BuilderController.php:376.

bluetheme_demo_imported

Fires after a demo was imported.

Parameter Type Description
$demo string Demo id.
$state array Import state (parts, languages, id maps).
$remap Remap Id maps of the main language.

Runs in inc/Demo/Importer.php:383.

bluetheme_demo_kept

Fires after an imported demo was kept as the site's own content.

Parameter Type Description
$demo string Demo id.

Runs in inc/Demo/Remover.php:148.

bluetheme_demo_removed

Fires after a demo was removed.

Parameter Type Description
$demo string Demo id.
$counts array What was removed.

Runs in inc/Demo/Remover.php:119.

bluetheme_dynamic_after

This action is documented in template-dynamic.php

Runs in single-bt_template.php:35, template-dynamic.php:26, template-dynamic.php:31.

bluetheme_dynamic_before

This action is documented in template-dynamic.php

Runs in single-bt_template.php:32, template-dynamic.php:24, template-dynamic.php:29.

bluetheme_options_saved

Fires after Theme Options were saved, reset or imported.

Parameter Type Description
$values array All values (defaults applied).

Runs in inc/Options/Options.php:213.

bluetheme_otp_registered

Fires after a one-time code sign-up created an account.

Parameter Type Description
$id int User id.
$channel string sms | email.
$target string Number or email.

Runs in inc/Account/Login.php:419.

bluetheme_sidebar_start

Fires at the start of a sidebar column, before its inner wrapper (the shop's filter panel adds its header here).

Parameter Type Description
$sidebar string Sidebar id.
$index int 0 = first sidebar, 1 = second.

Runs in sidebar.php:27.

bluetheme_sms_failed

Fires when an SMS code could not be sent (for logging).

Parameter Type Description
$result WP_Error Provider error.
$target string Number.

Runs in inc/Account/Login.php:304.

Filters

Change a value before the theme uses it: add_filter( 'name', $callback, $priority, $accepted_args ). The callback receives the value first and must return it.

bluetheme_admin_menu_title

Filters the admin menu title (white label mode changes it).

Parameter Type Description
$title string Title.

Runs in inc/Options/Admin/OptionsPage.php:56.

bluetheme_breadcrumbs

Filters the breadcrumb trail.

Parameter Type Description
$trail array List of [ label, url ].

Runs in inc/Template/Breadcrumbs.php:93.

bluetheme_breakpoints

Filters the device breakpoints (max-width, CSS length). Defaults match Bootstrap: xl 1200, lg 992, md 768.

Parameter Type Description
$breakpoints array Device => max-width.

Runs in inc/Options/Css/Compiler.php:41.

bluetheme_builder_choices

Filters the choices of a builder select field with "choices_from".

Parameter Type Description
$choices array Value => label (the field's own choices first).
$source string The "choices_from" name.

Runs in inc/Builder/Elements/Element.php:155.

bluetheme_builder_css_file

Filters whether the page uses its saved CSS file; when false the CSS is printed inline from the current document (previews).

Parameter Type Description
$use_file bool Use the file.
$post_id int Post id.

Runs in inc/Builder/Render/Assets.php:129.

bluetheme_builder_document_json

Filters the stored document JSON before it is used (the live builder preview swaps in the user's autosave).

Parameter Type Description
$json string Document JSON.
$post_id int Post id.

Runs in inc/Builder/Data/Document.php:59.

bluetheme_builder_element_dirs

Filters the element folders (path => URL). Plugins add their own folder of element modules here.

Parameter Type Description
$dirs array Folders.

Runs in inc/Builder/Elements/Registry.php:100.

bluetheme_builder_element_html

Filters the inner HTML of a rendered element.

Parameter Type Description
$inner string Element HTML.
$node array Node.

Runs in inc/Builder/Render/Renderer.php:175.

bluetheme_builder_element_plugin_active

Filters whether a plugin an element needs is running.

Parameter Type Description
$active bool Default.
$plugin string Plugin key from config.json.

Runs in inc/Builder/Elements/Registry.php:117.

bluetheme_builder_is_active

Filters whether a post is shown with the builder (the live builder canvas turns it on for the page being edited).

Parameter Type Description
$active bool Saved state.
$post_id int Post id.

Runs in inc/Builder/Builder.php:82.

bluetheme_builder_migrate

Filters a document after the theme's own upgrades (add-ons that store data in their elements can upgrade it here).

Parameter Type Description
$document array Document.
$version int Version it was saved with.

Runs in inc/Builder/Data/Migrations.php:43.

bluetheme_builder_post_css

This filter is documented in inc/Builder/Render/Assets.php

Runs in inc/Builder/Builder.php:169, inc/Builder/Render/Assets.php:75.

bluetheme_builder_post_types

Filters the post types that can be edited with BlueBuilder.

Parameter Type Description
$types string[] Post type names.

Runs in inc/Builder/Builder.php:61.

bluetheme_builder_vendors

Filters the libraries builder elements can require.

Parameter Type Description
$list array Name → [ script, style, version, deps ].

Runs in inc/Builder/Elements/Vendors.php:127.

bluetheme_card_actions

Filters the buttons over a product card's image.

Parameter Type Description
$html string Buttons HTML.
$product WC_Product Product.

Runs in inc/WooCommerce/CatalogExtras.php:166.

bluetheme_client_ip

Filters the visitor's IP address used for rate limits. Sites behind a proxy or CDN return the address from its trusted header.

Parameter Type Description
$ip string REMOTE_ADDR.

Runs in inc/Security/RateLimit.php:34.

bluetheme_compat_jalali_plugin_active

Filters whether a Jalali date plugin is active.

Parameter Type Description
$active bool Detected state.

Runs in inc/Compat/Plugins.php:49.

bluetheme_compat_seo_plugin

Filters the detected SEO plugin name ('' = none).

Parameter Type Description
$name string Plugin name.

Runs in inc/Compat/Plugins.php:75.

bluetheme_content_width

No description.

Runs in inc/Core/Setup.php:70.

Filters the footer copyright text (HTML allowed: links and emphasis).

Parameter Type Description
$text string Copyright text.

Runs in inc/template-functions.php:487.

bluetheme_demo_catalog

Filters the demos on offer.

Parameter Type Description
$demos array Id => demo (see Catalog).

Runs in inc/Demo/Catalog.php:49.

bluetheme_docs_url

Filters the address of the online documentation.

Parameter Type Description
$url string Address without a trailing slash.

Runs in inc/Docs/Docs.php:68.

bluetheme_element_query

This filter is documented in inc/PostTypes/Query.php

Runs in elements/blog/render.php:43, elements/blog-news/render.php:33, elements/blog-slider/render.php:35, elements/blog-teaser/render.php:32, elements/portfolio/render.php:47, inc/PostTypes/Query.php:77.

bluetheme_fonts_default_body

No description.

Runs in inc/Assets/Fonts.php:167.

bluetheme_fonts_families

Filters the bundled font families.

Parameter Type Description
$families array Families keyed by slug.

Runs in inc/Assets/Fonts.php:110.

Filters the footer style: default, sticky (kept at the bottom of short pages) or reveal (uncovered as the page scrolls). Footer templates set their own.

Parameter Type Description
$style string Style from Theme Options → Footer.

Runs in inc/Footer/Footer.php:43.

bluetheme_has_sidebar

Filters whether the sidebar is shown.

Parameter Type Description
$show bool Default decision.

Runs in inc/template-functions.php:23.

bluetheme_header_part

Filters the markup of a custom header part (for styles added with the bluetheme_header_styles filter).

Parameter Type Description
$html string Markup.
$part string Part name.

Runs in inc/Header/Parts.php:73.

bluetheme_header_position

Filters the header position for the current view.

Parameter Type Description
$position string default | transparent | absolute.

Runs in inc/Header/Header.php:98.

bluetheme_header_style

Filters the header style for the current view (Page Options use this).

Parameter Type Description
$id string Style id.

Runs in inc/Header/Header.php:60.

bluetheme_header_styles

Filters the classic header styles. Child themes can add a style by giving it a label and a recipe of rows.

Parameter Type Description
$styles array Styles keyed by id.

Runs in inc/Header/Styles.php:215.

bluetheme_i18n_machine_date_formats

Filters the list of machine-readable date formats.

Parameter Type Description
$formats string[] Formats.

Runs in inc/I18n/Locale.php:62.

bluetheme_icon_packs

Filters the icon packs offered in the icon picker.

Parameter Type Description
$packs array Packs.

Runs in inc/Icons/Registry.php:103.

bluetheme_jalali_enabled

Filters whether the theme converts dates to Jalali.

Parameter Type Description
$enabled bool Default from Theme Options; off while a Jalali plugin is active.

Runs in inc/I18n/Jalali/DateFilters.php:80.

bluetheme_layout

Filters the content layout of the current view.

Parameter Type Description
$layout array layout (none|start|end|both), sidebars (ids), width (narrow|standard|wide).

Runs in inc/Template/Layout.php:71.

bluetheme_library_sections

Filters the pre-built sections.

Parameter Type Description
$list array Id => [ label, category key, section node ].

Runs in inc/Library/Library.php:99.

bluetheme_live_builder_data

Filters the data the live builder starts with.

Parameter Type Description
$data array Data.
$post WP_Post Post being edited.

Runs in inc/Builder/Live/LiveBuilder.php:137.

bluetheme_location_override

Lets a feature print a location itself (it returns true when it did), before templates; the distraction free checkout uses it.

Parameter Type Description
$printed bool Whether the location was printed.
$location string header | footer.

Runs in inc/template-functions.php:89.

bluetheme_options

Filters the Theme Options values for this request.

Parameter Type Description
$values array Values keyed by field id.

Runs in inc/Options/Options.php:101.

bluetheme_options_capability

Filters the capability required to manage Theme Options.

Parameter Type Description
$capability string Capability.

Runs in inc/Options/Rest/OptionsController.php:51.

bluetheme_options_css

Filters the compiled options CSS before custom CSS is appended. Features use it to add rules that depend on option values.

Parameter Type Description
$css string Compiled CSS.
$values array Option values.

Runs in inc/Options/Css/Compiler.php:111.

bluetheme_options_sections

Filters the Theme Options sections.

Parameter Type Description
$sections array Section definitions in panel order.

Runs in inc/Options/Schema/Registry.php:56.

bluetheme_otp_ip

Filters the IP address the hourly code limit counts by.

Parameter Type Description
$ip string REMOTE_ADDR.

Runs in inc/Account/Codes.php:108.

bluetheme_otp_plugin_active

Filters whether another plugin handles one-time code login (the theme then hides its own forms).

Parameter Type Description
$found bool Whether Digits, Persian WooCommerce SMS or WP SMS is active.

Runs in inc/Account/Login.php:88.

bluetheme_page_options_post_types

Filters the post types that have Page Options.

Parameter Type Description
$types string[] Post types.

Runs in inc/PageOptions/PageOptions.php:63.

bluetheme_persian_digits_enabled

Filters whether the theme shows Persian digits.

Parameter Type Description
$enabled bool Default from Theme Options → Global → Localization.

Runs in inc/I18n/PersianDigits.php:72.

bluetheme_rate_limit

Filters a route's rate limit.

Parameter Type Description
$action string Route name.

Runs in inc/Security/RateLimit.php:51.

bluetheme_reading_speed

Filters the reading speed in words per minute.

Parameter Type Description
$speed int Words per minute.

Runs in inc/Blog/Blog.php:82.

bluetheme_schema_graph

Filters the schema.org graph.

Parameter Type Description
$graph array Nodes.

Runs in inc/Seo/Schema.php:81.

bluetheme_services

Filters the list of service classes booted by the theme.

Parameter Type Description
$classes class-string[] Service class names in boot order.

Runs in inc/Theme.php:57.

bluetheme_setup_plugins

Filters the plugins the setup wizard offers (slug => name, note).

Parameter Type Description
$list array Plugins.

Runs in inc/Demo/Plugins.php:57.

bluetheme_shop_script

Filters the shop script settings (quick view, wishlist and the other shop features add theirs).

Parameter Type Description
$config array Settings.

Runs in inc/WooCommerce/Cart.php:152.

bluetheme_sidebar_classes

Filters the classes of a sidebar column (the shop turns its sidebar into a filter panel on small screens).

Parameter Type Description
$classes string Classes.
$index int 0 = first sidebar, 1 = second.

Runs in inc/Template/Layout.php:140.

bluetheme_sms_gateways

Filters the SMS providers: id => class extending BlueTheme\Account\Sms\Gateway. Add a label for the id with the bluetheme_sms_provider_labels filter.

Parameter Type Description
$gateways array Gateways.

Runs in inc/Account/Sms/Gateways.php:34.

bluetheme_sms_provider_labels

Filters the SMS provider names (id => label); see bluetheme_sms_gateways.

Parameter Type Description
$labels array Labels.

Runs in inc/Options/Schema/Sections/Blog/Account.php:31.

bluetheme_social_networks

Filters the social network list.

Parameter Type Description
$networks array Networks keyed by slug.

Runs in inc/Social/Networks.php:152.

bluetheme_subheader_shows

Filters whether the subheader shows on the current view (Page Options use this).

Parameter Type Description
$show bool Decision.

Runs in inc/Template/Subheader.php:53.

bluetheme_subheader_title

Filters a custom title for the bar ('' keeps the usual one). Page Options set it per page.

Parameter Type Description
$title string Custom title.

Runs in inc/Template/Subheader.php:66.

bluetheme_template

Filters the template chosen for a type on the current request.

Parameter Type Description
$id int Template id (0 for none).
$type string Type key.

Runs in inc/Templates/Resolver.php:52.

bluetheme_template_presets

Filters the ready-made templates of a type.

Parameter Type Description
$list array Id => [ label, category, description, sections, settings ].
$type string header | footer.

Runs in inc/Templates/Presets/Presets.php:82.

bluetheme_template_types

Filters the template types.

Parameter Type Description
$types array Key => [ label, description, has conditions ].

Runs in inc/Templates/Types.php:63.

bluetheme_transparent_header

Filters whether the header template is transparent here (Page Options use this).

Parameter Type Description
$on bool Decision.
$id int Template id.

Runs in inc/Templates/Header.php:161.

bluetheme_visitor_output

Filters whether this request prints visitor-facing text (Persian digits, Jalali dates). REST routes that return page markup turn it on.

Parameter Type Description
$visitor bool Default.

Runs in inc/I18n/Locale.php:48.

bluetheme_wishlist_url

This filter is documented in inc/Header/Widgets.php

Runs in elements/header-wishlist/render.php:18, inc/Header/Widgets.php:185.