diff --git a/readme.txt b/readme.txt index e9c95573038..eaf06bcfa57 100644 --- a/readme.txt +++ b/readme.txt @@ -181,6 +181,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Fix - Better backwards compatibility with _woocommerce_exclude_image * Fix - is_on_sale() method now returns true for products with a sale product of 0 * Fix - Changed MyException to Exception in Checkout class as MyException class does not exist in WooCommerce +* Fix - For when get_the_terms() returns false inside woocommerce_get_product_terms() * Refactor - Taken out Piwik integration, use http://wordpress.org/extend/plugins/woocommerce-piwik-integration/ from now on * Refactor - Taken out ShareYourCart integration, use http://wordpress.org/extend/plugins/shareyourcart/ from now on * Refactor - Moved woocommerce_get_formatted_product_name function into WC_Product class diff --git a/woocommerce-core-functions.php b/woocommerce-core-functions.php index a130b0f6ad0..3124e8fe824 100644 --- a/woocommerce-core-functions.php +++ b/woocommerce-core-functions.php @@ -1479,6 +1479,10 @@ function woocommerce_get_product_terms( $object_id, $taxonomy, $fields = 'all' ) $terms = array(); $object_terms = get_the_terms( $object_id, $taxonomy ); + + if ( ! is_array( $object_terms ) ) + return array(); + $all_terms = array_flip( get_terms( $taxonomy, array( 'menu_order' => 'ASC', 'fields' => 'ids' ) ) ); switch ( $fields ) {