Added is_paying_customer() to easily check if a user is a WC customer:

Usage:

`
$customer = new WC_Customer();
$out      = 'Paying customer ? ';

if( $customer->is_paying_customer( 10 ) ) {
	$out .= "yes";
} else {
	$out .= "no";
}

echo $out;
`
This commit is contained in:
Remi Corson 2014-04-04 09:38:56 +02:00 committed by Mike Jolley
parent ca8e0380e5
commit 14267660da
1 changed files with 16 additions and 0 deletions

View File

@ -188,6 +188,22 @@ class WC_Customer {
}
return false;
}
/**
* Is the user a paying customer?
*
* @access public
* @return bool
*/
function is_paying_customer( $user_id ) {
$paying_customer = get_user_meta( $user_id, 'paying_customer', true );
if( $paying_customer != '' && absint( $paying_customer ) > 0) {
return true;
}
return false;
}
/**