WC_Product::has_file should return bool

Return false if downloadable product has no file attached.
This commit is contained in:
George Mamadashvili 2012-08-04 12:28:39 +04:00
parent 58dd2aca67
commit 59c2d18406
1 changed files with 7 additions and 1 deletions

View File

@ -270,7 +270,11 @@ class WC_Product {
}
/**
* Checks if a downloadable product has a file attached to it
* Check if downloadable product has a file attached.
*
* @since 1.6.2
*
* @return bool Whether downloadable product has a file attached.
*/
function has_file() {
if ( ! $this->is_downloadable() )
@ -278,6 +282,8 @@ class WC_Product {
if ( apply_filters( 'woocommerce_file_download_path', get_post_meta( $this->id, '_file_path', true ), $this->id ) )
return true;
return false;
}
/**