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:
Amritansh_tact9 2018-03-07 17:07:42 +05:30
parent 7e05af1296
commit 10e80c83d1
1 changed files with 2 additions and 1 deletions

View File

@ -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 ) ) {