Merge pull request #5464 from tamarazuk/master
Order Item Meta - Check if attribute term exists
This commit is contained in:
commit
d8020de76c
|
@ -60,7 +60,7 @@ class WC_Order_Item_Meta {
|
||||||
if ( taxonomy_exists( $attribute_key ) ) {
|
if ( taxonomy_exists( $attribute_key ) ) {
|
||||||
$term = get_term_by( 'slug', $meta_value, $attribute_key );
|
$term = get_term_by( 'slug', $meta_value, $attribute_key );
|
||||||
|
|
||||||
if ( ! is_wp_error( $term ) && $term->name ) {
|
if ( ! is_wp_error( $term ) && is_object( $term ) && $term->name ) {
|
||||||
$meta_value = $term->name;
|
$meta_value = $term->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue