Properties

$attribute_labels

$attribute_labels :

Type

$variation_attributes

$variation_attributes :

Type

$tables_on_page

$tables_on_page :

Type

Methods

array_pad_and_slice()

array_pad_and_slice(array  $array,integer  $size,mixed  $pad): array

Combination of array_pad and array_slice.

Parameters

array $array

Input array

integer $size

The size of the array to return

mixed $pad

What to pad with

Returns

array —

The result

array_diff_assoc()

array_diff_assoc(array  $array1,array  $array2): array

Similar to <code>array_diff_assoc</code>, but does a loose type comparison on array values (== not ===).

Supports multi-dimensional arrays, but doesn't support passing more than two arrays.

Parameters

array $array1

The main array to compare against

array $array2

The array to compare with

Returns

array —

All entries in $array1 which are not present in $array2 (including key check)

list_pluck_array()

list_pluck_array(array  $list,array|string  $keys = array()): array

Similar to <code>wp_list_pluck</code> or <code>array_column</code> but plucks several keys from the source array.

Parameters

array $list

The array of arrays to extract the keys from

array|string $keys

The list of keys to pluck

Returns

array —

An array returned in the same order as $list, but where each item in the array contains just the specified $keys

string_list_to_array()

string_list_to_array(  $arg)

Parameters

$arg

empty_if_false()

empty_if_false(  $var)

Parameters

$var

maybe_parse_bool()

maybe_parse_bool(  $maybe_bool)

Parameters

$maybe_bool

sanitize_list_arg()

sanitize_list_arg(  $arg,  $allow_space = false)

Parameters

$arg
$allow_space

sanitize_list_arg_allow_space()

sanitize_list_arg_allow_space(  $arg)

Parameters

$arg

sanitize_string_or_array_arg()

sanitize_string_or_array_arg(  $arg)

Parameters

$arg

sanitize_numeric_list_arg()

sanitize_numeric_list_arg(  $arg)

Parameters

$arg

sanitize_string_or_bool_arg()

sanitize_string_or_bool_arg(  $arg)

Parameters

$arg

sanitize_class_name()

sanitize_class_name(  $class)

Parameters

$class

set_object_vars()

set_object_vars(  $object,  $vars)

Parameters

$object
$vars

convert_to_term_ids()

convert_to_term_ids(  $terms,  $taxonomy)

Parameters

$terms
$taxonomy

get_all_term_children()

get_all_term_children(  $term_ids,  $taxonomy,  $include_parents = false)

Parameters

$term_ids
$taxonomy
$include_parents

get_terms()

get_terms(  $args = array())

Parameters

$args

extract_attributes()

extract_attributes(array  $array): array

Pull the attributes from the specified array, which may contain a mix of different data.

E.g. extract_attributes( array( 'name' => 'product1', 'id' => '123' 'attribute_pa_size' => 'medium', 'attribute_pa_color' => 'red' ) );

would return an array with the two attributes - attribute_pa_size and attribute_pa_color.

Parameters

array $array

The array to extract from

Returns

array —

Just the attributes, or an empty array if there are none.

get_attribute_name()

get_attribute_name(  $attribute_name)

Parameters

$attribute_name

get_attribute_label()

get_attribute_label(  $name,  $product = '')

Parameters

$name
$product

get_available_variations()

get_available_variations(\WC_Product_Variable  $product): array

Similar to WC_Product_Variable->get_available_variations() but returns an array of WC_Product_Variation objects rather than arrays.

Parameters

\WC_Product_Variable $product

The product to get variations for

Returns

array —

An array of WC_Product_Variation objects

get_variation_attributes()

get_variation_attributes(  $product)

Parameters

$product

get_acf_field_object()

get_acf_field_object(  $field,  $post_id = false)

Parameters

$field
$post_id

is_acf_active()

is_acf_active()

get_product_name()

get_product_name(  $product)

Parameters

$product

format_product_link()

format_product_link(  $product,  $link_text = '',  $link_class = array())

Parameters

$product
$link_text
$link_class

format_loop_add_to_cart_link()

format_loop_add_to_cart_link(  $link)

Parameters

$link

get_post()

get_post(  $product)

Parameters

$product

maybe_get_parent()

maybe_get_parent(\WC_Product  $product): \WC_Product

Return the parent for the given product, if there is one, otherwise it returns the original product.

Parameters

\WC_Product $product

The product.

Returns

\WC_Product —

Either the parent product or the original product.

get_parent()

get_parent(\WC_Product  $product): \WC_Product

Gets the parent product for the given product, or false if there is no parent.

Parameters

\WC_Product $product

The product.

Returns

\WC_Product —

The parent product or false.

get_product_addons()

get_product_addons(  $product_id)

Parameters

$product_id

get_layered_nav_params()

get_layered_nav_params(  $lazy_load = false)

Parameters

$lazy_load

array_filter_layered_nav_params()

array_filter_layered_nav_params(  $value)

Parameters

$value

escape_json_attribute()

escape_json_attribute(  $json)

Parameters

$json

format_script()

format_script(  $script)

Parameters

$script

jquery_to_php_date_format()

jquery_to_php_date_format(string  $jQueryFormat): string

Convert a jQuery date format to a PHP one. E.g. 'dd-mm-yy' becomes 'd-m-Y'.

See http://api.jqueryui.com/datepicker/ for jQuery formats.

Parameters

string $jQueryFormat

The jQuery date format

Returns

string —

The equivalent PHP date format

is_european_date_format()

is_european_date_format(  $format)

Parameters

$format

is_unix_epoch_time()

is_unix_epoch_time(mixed  $value): boolean

Is the value passed a valid UNIX epoch time (i.e. seconds elapsed since 1st January 1970)?

Not a perfect implementation as it will return false for valid timestamps representing dates between 31st October 1966 and 3rd March 1973, but this is needed to prevent valid dates held in numeric formats (e.g. 20171201) being wrongly interpreted as timestamps.

Parameters

mixed $value

The value to check

Returns

boolean —

True if $value is a valid epoch timestamp

strtotime()

strtotime(string  $date): integer|boolean

Convert a date string to a timestamp. A wrapper around strtotime which accounts for dates already formatted as a timestamp.

Parameters

string $date

The date to convert to a timestamp.

Returns

integer|boolean —

The timestamp (number of seconds since the Epoch) for this date, or false on failure.

is_valid_search_term()

is_valid_search_term(  $search_term)

Parameters

$search_term

get_image_size_width()

get_image_size_width(  $size)

Parameters

$size

is_table_on_page()

is_table_on_page()

get_tables_on_page()

get_tables_on_page()

get_button_class()

get_button_class()

get_wrapper_class()

get_wrapper_class()

get_asset_url()

get_asset_url(  $path = '')

Parameters

$path

get_wc_asset_url()

get_wc_asset_url(  $path = '')

Parameters

$path

get_template_path()

get_template_path()

get_server_request_method()

get_server_request_method()

get_shop_messages()

get_shop_messages()

doing_lazy_load()

doing_lazy_load()

is_wc_active()

is_wc_active()

is_wc_product_addons_active()

is_wc_product_addons_active()

is_wc_ppc_active()

is_wc_ppc_active()

is_quick_view_pro_active()

is_quick_view_pro_active()

get_table_shortcodes_in_post_content()

get_table_shortcodes_in_post_content()