Theme_Bricks extends Theme_Integration

Provides integration with the Bricks theme.

Table of Contents

INTEGRATION_PREFIX  = '_bricks'
Holds the prefix used for identifying the query.
$found_element  : string
Name of the element found.
$template  : string
Holds the template name.
$cache  : Query_Cache
Holds the query and filters cache handler.
$products_query_counter  : int
For some reason this page builder runs queries twice.
add_controls()  : array<string|int, mixed>
Add a control to the Bricks WooCommerce Products element to allow the user to enable/disable the plugin.
assets()  : void
Enqueue the integration script.
enqueue_dummy_handle()  : void
Enqueue dummt handle.
enqueue_fix()  : void
Theme-specific inline css styling.
get_dummy_handle()  : string
Generate an handle name for the dummy stylesheet to which we'll attach the custom inline styling.
get_element()  : array<string|int, mixed>
Get the element data from the database.
maybe_detect_query()  : array<string|int, mixed>
Detect the query and store the element id.
maybe_insert_search_query()  : void
Insert the search query into the query vars.
maybe_order_results()  : void
Order the results based on the selected orderby value.
register()  : void
Hook into WP.
set_products_query_vars()  : array<string|int, mixed>
Set the query vars for the products query.
shortcode()  : string
Registers a new shortcode responsible of displaying the custom elements for the Bricks theme.
should_enqueue()  : bool
Determine if the inline styling should enqueue or not.
theme_inline_styling()  : void
Load the inline styling when needed.

Constants

INTEGRATION_PREFIX

Holds the prefix used for identifying the query.

public mixed INTEGRATION_PREFIX = '_bricks'

Properties

$found_element

Name of the element found.

public string $found_element = ''

$template

Holds the template name.

public string $template = 'bricks'

$products_query_counter

For some reason this page builder runs queries twice.

private int $products_query_counter = 0

Methods

add_controls()

Add a control to the Bricks WooCommerce Products element to allow the user to enable/disable the plugin.

public add_controls(array<string|int, mixed> $controls) : array<string|int, mixed>
Parameters
$controls : array<string|int, mixed>

The existing controls.

Return values
array<string|int, mixed>

The modified controls.

assets()

Enqueue the integration script.

public assets() : void
Return values
void

enqueue_dummy_handle()

Enqueue dummt handle.

public enqueue_dummy_handle() : void
Return values
void

enqueue_fix()

Theme-specific inline css styling.

public enqueue_fix() : void
Tags
inheritdoc
Return values
void

get_dummy_handle()

Generate an handle name for the dummy stylesheet to which we'll attach the custom inline styling.

public get_dummy_handle() : string
Return values
string

get_element()

Get the element data from the database.

public get_element(int $post_id, string $element_id) : array<string|int, mixed>
Parameters
$post_id : int
$element_id : string
Return values
array<string|int, mixed>

maybe_detect_query()

Detect the query and store the element id.

public maybe_detect_query(array<string|int, mixed> $query_vars, array<string|int, mixed> $settings, string $element_id) : array<string|int, mixed>
Parameters
$query_vars : array<string|int, mixed>
$settings : array<string|int, mixed>
$element_id : string
Return values
array<string|int, mixed>

maybe_insert_search_query()

Insert the search query into the query vars.

public maybe_insert_search_query(Collection $filters, array<string|int, mixed> &$query_vars) : void
Parameters
$filters : Collection
$query_vars : array<string|int, mixed>
Return values
void

maybe_order_results()

Order the results based on the selected orderby value.

public maybe_order_results(string $orderby, array<string|int, mixed> &$query_vars) : void
Parameters
$orderby : string
$query_vars : array<string|int, mixed>
Return values
void

register()

Hook into WP.

public register() : void
Tags
inheritdoc
Return values
void

set_products_query_vars()

Set the query vars for the products query.

public set_products_query_vars(array<string|int, mixed> $query_vars, array<string|int, mixed> $settings, string $element_id) : array<string|int, mixed>
Parameters
$query_vars : array<string|int, mixed>
$settings : array<string|int, mixed>
$element_id : string
Return values
array<string|int, mixed>

shortcode()

Registers a new shortcode responsible of displaying the custom elements for the Bricks theme.

public shortcode() : string
Return values
string

should_enqueue()

Determine if the inline styling should enqueue or not.

public should_enqueue() : bool

Usually you check that the specific theme is enabled here.

Return values
bool

theme_inline_styling()

Load the inline styling when needed.

public theme_inline_styling() : void
Return values
void

Search results