You appear to be a bot. Output may be restricted
Description
Get things going
Usage
EDD_Customer::__construct( $_id_or_email, $by_user_id );
Parameters
- $_id_or_email
- ( mixed ) optional –
- $by_user_id
- ( mixed ) optional –
Returns
void
Source
File name: easy-digital-downloads/includes/class-edd-customer.php
Lines:
1 to 26 of 26
public function __construct( $_id_or_email = false, $by_user_id = false ) { if ( false === $_id_or_email || ( is_numeric( $_id_or_email ) && absint( $_id_or_email ) !== (int) $_id_or_email ) ) { return false; } $by_user_id = is_bool( $by_user_id ) ? $by_user_id : false; if ( is_object( $_id_or_email ) ) { $customer = $_id_or_email; } else { if ( is_numeric( $_id_or_email ) ) { $field = $by_user_id ? 'user_id' : 'id'; } else { $field = 'email'; } $customer = edd_get_customer_by( $field, $_id_or_email ); } if ( empty( $customer ) || ! is_object( $customer ) ) { return false; } $this->setup_customer( $customer ); }