Theme_Divi extends Theme_Integration implements JsonSerializable, Fallback_Aware_Interface Uses Fallback_Aware

Divi theme-specific styling.

Interfaces, Classes and Traits

JsonSerializable
Fallback_Aware_Interface
Indicates that a class is making use of the fallback mode.

Table of Contents

$template  : string
The name of the current template.
$types  : mixed
add_tags()  : void
Wraps the output of the [products] shortcode with a custom div and generate our fallback elements for prefilling.
apply_fallback_mode()  : bool
Enable fallback mode for the theme.
apply_integration_flag()  : array<string|int, mixed>
Insert a special flag into the WP_Query args array used by the query that retrieves filtered post ids.
assets()  : void
Load the assets specific to this integration.
attach_flag()  : void
Attach flag to wc shortcodes query.
change_mode()  : string
Change the filter mode to button because automatic mode is not supported when fallback mode is enabled.
enqueue_dummy_handle()  : void
Enqueue dummt handle.
enqueue_fix()  : void
Theme-specific inline css styling.
enqueue_json()  : void
Load json values needed for the fallback js.
filter_query()  : void
Insert the filtered results into the query.
generate_fallback_output()  : void
Generates the output of our fallback elements.
get_dummy_handle()  : string
Generate an handle name for the dummy stylesheet to which we'll attach the custom inline styling.
get_page_base_url()  : string
Get the base url for the fallback mode.
get_query_argument_id()  : string
Get the string that is then attached as an argument to the WP_Query $args array as a flag.
get_requested_filters()  : string
Get the value of the url query string that holds the filters selected via the form.
get_requested_orderby()  : string
Get the value of the url query string that holds the orderby parameter.
jsonSerialize()  : array<string|int, mixed>
Prepare fallback json array.
load_fallback_hooks()  : void
Load hooks for the fallback mode.
maybe_adjust_product_table()  : void
Maybe adjust the product table integration to force the display of the required elements when the theme builder overrides the shop page and the shop page contains the product table shortcode.
register()  : void
Hook into WP.
should_enqueue()  : bool
Determine if the inline styling should enqueue or not.
theme_inline_styling()  : void
Load the inline styling when needed.
is_main_query()  : bool
Determine if it's a query we should be filtering or not.

Properties

$template

The name of the current template.

public string $template = 'Divi'

Use wp_get_theme to get it.

$types

public mixed $types = ['recent_products', 'products', 'sale_products', 'best_selling_products', 'top_rated_products', 'featured_products']

Methods

add_tags()

Wraps the output of the [products] shortcode with a custom div and generate our fallback elements for prefilling.

public add_tags(array<string|int, mixed> $attributes) : void
Parameters
$attributes : array<string|int, mixed>
Return values
void

apply_fallback_mode()

Enable fallback mode for the theme.

public apply_fallback_mode(bool $enabled) : bool
Parameters
$enabled : bool
Return values
bool

apply_integration_flag()

Insert a special flag into the WP_Query args array used by the query that retrieves filtered post ids.

public apply_integration_flag(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
$args : array<string|int, mixed>
Return values
array<string|int, mixed>

assets()

Load the assets specific to this integration.

public assets() : void
Return values
void

attach_flag()

Attach flag to wc shortcodes query.

public attach_flag() : void
Return values
void

change_mode()

Change the filter mode to button because automatic mode is not supported when fallback mode is enabled.

public change_mode(string $value, string $key, string $default) : string
Parameters
$value : string
$key : string
$default : string
Return values
string

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

enqueue_json()

Load json values needed for the fallback js.

public enqueue_json() : void
Return values
void

filter_query()

Insert the filtered results into the query.

public filter_query(WP_Query $query) : void

This is used via pre_get_posts.

Parameters
$query : WP_Query
Return values
void

generate_fallback_output()

Generates the output of our fallback elements.

public generate_fallback_output(array<string|int, mixed> $products) : void
Parameters
$products : array<string|int, mixed>
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_page_base_url()

Get the base url for the fallback mode.

public get_page_base_url() : string
Return values
string

get_query_argument_id()

Get the string that is then attached as an argument to the WP_Query $args array as a flag.

public get_query_argument_id() : string

The flag is used to shortcircuit our filtered results injection.

Without the flag we'd end up causing an infinite loop.

Return values
string

get_requested_filters()

Get the value of the url query string that holds the filters selected via the form.

public get_requested_filters() : string
Return values
string

get_requested_orderby()

Get the value of the url query string that holds the orderby parameter.

public get_requested_orderby() : string
Return values
string

jsonSerialize()

Prepare fallback json array.

public jsonSerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

load_fallback_hooks()

Load hooks for the fallback mode.

public load_fallback_hooks() : void
Return values
void

maybe_adjust_product_table()

Maybe adjust the product table integration to force the display of the required elements when the theme builder overrides the shop page and the shop page contains the product table shortcode.

public maybe_adjust_product_table() : void
Return values
void

register()

Hook into WP.

public register() : void
Tags
inheritdoc
Return values
void

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

is_main_query()

Determine if it's a query we should be filtering or not.

private is_main_query(WP_Query $query) : bool
Parameters
$query : WP_Query
Return values
bool

Search results