woocommerce-compat.php

Provides backwards compatibility for sites running older versions of WooCommerce.

Tags
author

Barn2 Plugins [email protected]

license

GPL-3.0

copyright

Barn2 Media Ltd

Table of Contents

wc_esc_json()  : string
Escape JSON for use on HTML or attribute text nodes.
woocommerce_product_loop()  : bool
Should the WooCommerce loop be displayed?

Functions

wc_esc_json()

Escape JSON for use on HTML or attribute text nodes.

wc_esc_json(string $json[, bool $html = false ]) : string
Parameters
$json : string

JSON to escape.

$html : bool = false

True if escaping for HTML text node, false for attributes. Determines how quotes are handled.

Tags
since
3.5.5
Return values
string

Escaped JSON.

woocommerce_product_loop()

Should the WooCommerce loop be displayed?

woocommerce_product_loop() : bool

This will return true if we have posts (products) or if we have subcats to display.

Tags
since
3.4.0
Return values
bool

Search results