ivav_setup_js_internal(); return $this->ivav_edit_profile_action($attributes); } public function ivav_iframe_shortcode($attributes, $content = null) { $this->ivav_setup_js_internal(); $userId = get_current_user_id(); $av = IvavAgeVerify::load($userId, null); if ($av->isVerified == true) { return ""; } $ip = $_SERVER['REMOTE_ADDR']; $user = wp_get_current_user(); $data = []; if ($user !== null) { $data['firstname'] = $user->first_name; $data['lastname'] = $user->last_name; } $r = $this->ivav_api_create($userId, $ip, 'profile', $av->guidTmp, $data); $guid = $r['request_guid']; if ($userId > 0 && $guid != $av->guidTmp) { $av->guidTmp = $guid; $av->save($userId); } $this->iframe = $r['iframeurl']; $iframe = ""; return $iframe; } public function ivav_wc_edit_account_form() { $msg = $this->ivav_edit_profile_action(); echo "
Age Verify Status
$msg
"; } private function ivav_edit_profile_action($attributes = null) { $userId = get_current_user_id(); $av = IvavAgeVerify::load($userId, null); $verified = 0; if ($av->isVerified() == true) { $description = "Verified"; if (isset($attributes['verified'])) { $description = $attributes['verified']; } $msg = " Verified "; } else { $ip = $_SERVER['REMOTE_ADDR']; $user = wp_get_current_user(); $data = []; if ($user !== null) { $data['firstname'] = $user->first_name; $data['lastname'] = $user->last_name; } $r = $this->ivav_api_create($userId, $ip, 'profile', $av->guidTmp, $data); $guid = $r['request_guid']; if ($userId > 0 && $guid != $av->guidTmp) { $av->guidTmp = $guid; $av->save($userId); } $this->iframe = $r['iframeurl']; $customerMessage = $this->customerMessage; if ($this->thankyouInline == 'inline') { $msg = " "; } else { $description = "Unverified. To complete an order, click here to verify your age.

"; if (isset($attributes['unverified'])) { $description = "{$attributes[unverified]}"; } $msg = "

$description

"; } } return $msg; } }