Template_Handler implements Premium_Service, Registerable
This class handles adding the restaurant order form to the WooCommerce shop pages.
Tags
Interfaces, Classes and Traits
- Premium_Service
- Registerable
Table of Contents
- clear_output_buffer() : mixed
- Discard the contents of the WooCommerce loop for the current template. This will be the entire products grid, plus things like sorting and catalogue options.
- disable_woocommerce_loop() : mixed
- Disable the WooCommerce loop for the current template, and start output buffering.
- display_restaurant_menu_category_page() : mixed
- Display the restaurant menu for the category pages.
- display_restaurant_menu_shop_page() : mixed
- Display the restaurant menu for the shop page.
- maybe_strip_restaurant_shortcode() : string
- For sites upgraded from < 3.0.1, they could have the restaurant shortcode in the Shop page content, so we need to remove it.
- override_shop_template() : mixed
- Register hooks for overriding the WooCommerce shop templates.
- register() : mixed
- Register any WordPress hooks.
- should_override_category_template() : bool
- Should we override the default WooCommerce category page template?
- should_override_shop_template() : bool
- Should we override the default WooCommerce shop page template?
Methods
clear_output_buffer()
Discard the contents of the WooCommerce loop for the current template. This will be the entire products grid, plus things like sorting and catalogue options.
public
clear_output_buffer() : mixed
Return values
mixed —disable_woocommerce_loop()
Disable the WooCommerce loop for the current template, and start output buffering.
public
disable_woocommerce_loop() : mixed
Return values
mixed —display_restaurant_menu_category_page()
Display the restaurant menu for the category pages.
public
display_restaurant_menu_category_page() : mixed
Return values
mixed —display_restaurant_menu_shop_page()
Display the restaurant menu for the shop page.
public
display_restaurant_menu_shop_page() : mixed
Return values
mixed —maybe_strip_restaurant_shortcode()
For sites upgraded from < 3.0.1, they could have the restaurant shortcode in the Shop page content, so we need to remove it.
public
maybe_strip_restaurant_shortcode(string $content) : string
Parameters
- $content : string
-
The content.
Return values
string —The content.
override_shop_template()
Register hooks for overriding the WooCommerce shop templates.
public
override_shop_template() : mixed
Tags
Return values
mixed —register()
Register any WordPress hooks.
public
register() : mixed
Return values
mixed —should_override_category_template()
Should we override the default WooCommerce category page template?
private
should_override_category_template() : bool
Return values
bool —true if we're overriding the category template
should_override_shop_template()
Should we override the default WooCommerce shop page template?
private
should_override_shop_template() : bool
Return values
bool —true if we're overriding the shop template