* Fixes issue #33335 Check for an empty string instead of an empty variable. * Update wc-product-functions.php * Update wc-product-functions.php * Changelog * Fix cases when $term is false or empty array Co-authored-by: Peter Fabian <peter.fabian.github@gmail.com>
This commit is contained in:
parent
d2967e0ee8
commit
2c721c7c88
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
Correct generation of variation name when attribute is 0.
|
|
@ -392,7 +392,7 @@ function wc_get_formatted_variation( $variation, $flat = false, $include_names =
|
|||
// If this is a term slug, get the term's nice name.
|
||||
if ( taxonomy_exists( $name ) ) {
|
||||
$term = get_term_by( 'slug', $value, $name );
|
||||
if ( ! is_wp_error( $term ) && ! empty( $term->name ) ) {
|
||||
if ( ! is_wp_error( $term ) && $term && null !== $term->name && '' !== $term->name ) {
|
||||
$value = $term->name;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue