$attribute_labels
$attribute_labels :
Utility functions for WooCommerce Product Table.
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.
array | $array1 | The main array to compare against |
array | $array2 | The array to compare with |
All entries in $array1 which are not present in $array2 (including key check)
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.
array | $list | The array of arrays to extract the keys from |
array|string | $keys | The list of keys to pluck |
An array returned in the same order as $list, but where each item in the array contains just the specified $keys
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.
array | $array | The array to extract from |
Just the attributes, or an empty array if there are none.
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.
\WC_Product_Variable | $product | The product to get variations for |
An array of WC_Product_Variation objects
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.
string | $jQueryFormat | The jQuery date format |
The equivalent PHP date format
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.
mixed | $value | The value to check |
True if $value is a valid epoch timestamp
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.
string | $date | The date to convert to a timestamp. |
The timestamp (number of seconds since the Epoch) for this date, or false on failure.