fixed docblock for meta_is_product_attribute() function, closes #4668

This commit is contained in:
claudiosmweb 2014-02-07 15:56:58 -02:00
parent 7dd98549d9
commit a9f1d47a11
1 changed files with 5 additions and 4 deletions

View File

@ -238,17 +238,18 @@ if ( ! function_exists( 'meta_is_product_attribute' ) ) {
/**
* Returns true when the passed meta name is a product attribute.
*
* @param $name of the attribute
* @param $product_id
* @param string $name of the attribute
* @param mixed $value
* @param int $product_id
* @return bool
*/
function meta_is_product_attribute( $name, $value, $product_id ) {
$product = get_product( $product_id );
if ( $product->product_type != 'variation' ) {
return false;
}
$attributes = $product->get_variation_attributes();
return ( in_array( $name, array_keys( $attributes ) ) && in_array( $value, $attributes[ $name ] ) );