Theme_Avada extends Theme_Integration implements JsonSerializable, Fallback_Aware_Interface Uses Fallback_Aware
Avada 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.
- $toggled : bool
- adjust_shortcode_params() : array<string|int, mixed>
- Adjust the shortcode params to enable filtering.
- 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.
- bypass_loop_tag() : bool
- Avada fires custom queries on the archive page which break detection of the WC loop.
- catch_page_with_post_cards() : void
- Check if the current page has the post cards module and fire the fallback hooks.
- 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.
- 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.
- inject_required_elements() : string
- Inject missing html elements inside the theme builder provided by Avada.
- is_fusion_builder_active() : bool
- Check if the Fusion Builder is active for the current post.
- jsonSerialize() : array<string|int, mixed>
- Prepare fallback json array.
- load_fallback_hooks() : void
- Load hooks for the fallback mode.
- page_content_has_post_cards_shortcode() : bool
- Check if the currently queried page has the post cards module shortcode.
- query_args() : array<string|int, mixed>
- Add a query arg to the postcard element to enable filtering.
- register() : void
- Hook into WP.
- replace_pagination() : string
- Replace the pagination html with a div that is used by the react app to display.
- setup_postcard_params() : array<string|int, mixed>
- Insert a custom option into the postcard element.
- shop_page_has_product_table_via_builder() : bool
- Check if the shop page has a product table via the Fusion Builder.
- should_enqueue() : bool
- Determine if the inline styling should enqueue or not.
- should_update_query_vars() : bool
- Modify the logic that determines if the query vars should be updated.
- 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.
- queried_object_has_override() : bool
- Determine if the queried object has a template override that contains the post cards module.
- setup_overrides_for_page() : void
- Setup hooks override for the post cards.
Properties
$template
The name of the current template.
public
string
$template
= 'Avada'
Use wp_get_theme to get it.
$toggled
public
bool
$toggled
= false
Methods
adjust_shortcode_params()
Adjust the shortcode params to enable filtering.
public
adjust_shortcode_params(array<string|int, mixed> $args, array<string|int, mixed> $defaults, array<string|int, mixed> $args_unfiltered, string $element) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
- $defaults : array<string|int, mixed>
- $args_unfiltered : array<string|int, mixed>
- $element : string
Return values
array<string|int, mixed> —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 —bypass_loop_tag()
Avada fires custom queries on the archive page which break detection of the WC loop.
public
bypass_loop_tag(bool $bypass, WP_Query $query, Display $instance) : bool
We use the filter to add further checks required to validate that we're firing the loop tags in the appropriate loop.
Parameters
- $bypass : bool
- $query : WP_Query
- $instance : Display
Return values
bool —catch_page_with_post_cards()
Check if the current page has the post cards module and fire the fallback hooks.
public
catch_page_with_post_cards() : 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
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 —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 —inject_required_elements()
Inject missing html elements inside the theme builder provided by Avada.
public
inject_required_elements(string $html, array<string|int, mixed> $args) : string
Parameters
- $html : string
- $args : array<string|int, mixed>
Return values
string —is_fusion_builder_active()
Check if the Fusion Builder is active for the current post.
public
is_fusion_builder_active(int $post_id) : bool
Parameters
- $post_id : int
-
The post ID.
Return values
bool —Whether or not the Fusion Builder is active.
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 —page_content_has_post_cards_shortcode()
Check if the currently queried page has the post cards module shortcode.
public
page_content_has_post_cards_shortcode() : bool
Return values
bool —query_args()
Add a query arg to the postcard element to enable filtering.
public
query_args(array<string|int, mixed> $args) : array<string|int, mixed>
Parameters
- $args : array<string|int, mixed>
Return values
array<string|int, mixed> —register()
Hook into WP.
public
register() : void
Tags
Return values
void —replace_pagination()
Replace the pagination html with a div that is used by the react app to display.
public
replace_pagination(mixed $pagination_html, mixed $max_pages, mixed $range, mixed $current_query, mixed $blog_global_pagination) : string
Parameters
- $pagination_html : mixed
- $max_pages : mixed
- $range : mixed
- $current_query : mixed
- $blog_global_pagination : mixed
Return values
string —setup_postcard_params()
Insert a custom option into the postcard element.
public
setup_postcard_params(array<string|int, mixed> $map, string $class_name) : array<string|int, mixed>
Parameters
- $map : array<string|int, mixed>
- $class_name : string
Return values
array<string|int, mixed> —shop_page_has_product_table_via_builder()
Check if the shop page has a product table via the Fusion Builder.
public
shop_page_has_product_table_via_builder() : bool
Return values
bool —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 —should_update_query_vars()
Modify the logic that determines if the query vars should be updated.
public
should_update_query_vars(bool $should_update, WP_Query $query, Display $instance) : bool
This is because Avada fires multiple queries on the archive page which break the detection of the WC loop.
Parameters
- $should_update : bool
-
Whether or not the query vars should be updated.
- $query : WP_Query
-
The WP_Query instance (passed by reference).
- $instance : Display
-
The Display instance.
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 —queried_object_has_override()
Determine if the queried object has a template override that contains the post cards module.
private
queried_object_has_override() : bool
Return values
bool —setup_overrides_for_page()
Setup hooks override for the post cards.
private
setup_overrides_for_page() : void