Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if (is_user_logged_in()) {
- $current_user = wp_get_current_user(); ?>
- // Update the visitor's full name with their WordPress display name.
- olark('api.visitor.updateFullName', {
- fullName: "<?php echo htmlspecialchars($current_user->display_name, ENT_QUOTES); ?>"
- });
- // Update the visitor's email address with their WordPress account email.
- olark('api.visitor.updateEmailAddress', {
- emailAddress: "<?php echo htmlspecialchars($current_user->user_email, ENT_QUOTES); ?>"
- });
- <?php // Get the customer in Easy Digital Downloads.
- if (class_exists('EDD_Customer')) {
- $oCustomer = new EDD_Customer($current_user->user_email);
- $nID = $oCustomer->id;
- if ($nID != 0) {
- $sCustomerURL = admin_url('edit.php?post_type=download&page=edd-customers&view=overview&id=' . urlencode($nID)); ?>
- // Sends the operator a link to the customer's profile page.
- olark('api.chat.onBeginConversation', function () {
- // Notifies the operator - the visitor does not see this
- olark('api.chat.sendNotificationToOperator', {
- body: "Customer Page: <?php echo $sCustomerURL; ?>"
- });
- });
- <?php }
- }
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement