Applied array_filter() to the $avaiable_variations in WC_Product_Variable::get_available_variations() to ensure only array type values get returned.
Added docbock in favor of boolean false for WC_Product_Variable::get_available_variation()
This commit is contained in:
parent
7e05af1296
commit
10e80c83d1
|
@ -292,6 +292,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
|
||||
$available_variations[] = $this->get_available_variation( $variation );
|
||||
}
|
||||
$available_variations = array_filter( $available_variations );
|
||||
|
||||
return $available_variations;
|
||||
}
|
||||
|
@ -302,7 +303,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
*
|
||||
* @param WC_Product $variation Variation product object or ID
|
||||
*
|
||||
* @return array
|
||||
* @return array|bool
|
||||
*/
|
||||
public function get_available_variation( $variation ) {
|
||||
if ( is_numeric( $variation ) ) {
|
||||
|
|
Loading…
Reference in New Issue