As Howdy_McGee said, you need to reference the individual data points, not the whole user object.
<?php
// Get the user object: username, email, firstname, lastname, displayname, and user ID
$current_user = wp_get_current_user();
// Get other user meta, such as phone number
// (you'll have to check what meta_key you're using for info like this)
$current_user_meta = get_user_meta($current_user->ID);
?>
$zoho.salesiq.ready=function()
{
$zoho.salesiq.visitor.name("<?php echo $current_user->display_name; ?>");
$zoho.salesiq.visitor.email("<?php echo $current_user->user_email; ?>");
$zoho.salesiq.visitor.contactnumber("<?php echo $current_user_meta->phone; ?>");
}
Related Posts:
- Youtube api – stop video
- TypeError: res.status is not a function
- WP Rest API – How to get featured image
- Is it Possible to Extend WP Customize JS Methods?
- Show only images and videos in a wp.media window
- WordPress Rest API
- Is it possible to enqueue the Youtube API script or does it have to be inline?
- Customizer JS API: Defining control settings
- Headless WordPress: How to authenticate front end requests?
- Customizer JS API: Adding Setting Dynamically Not Working
- Is there a client side API for handling transients or options?
- Customizer JS API: Adding a “dropdown-pages” control
- How to disable inline css styles generated by Gutenberg editor?
- WordPress customizer get control
- Get a default value of the Customizer setting using wp.customize API (JS)
- This page can’t load Google Maps correctly [closed]
- Customizer JS API: Defining active_callback for a section
- how to use nimble-API and Display data?
- create timestamp links to jump to specific times on rumble videos
- WordPress Guternberg Content For React Native
- Show sections based on a control in WordPress Customizer using JS API
- I would like to retrive JSON value and display it in wordpress page or widget
- How do I add a class to Customizer preview based on class of Customizer control? (Customizer Javascript API)
- Get a default customizeAction text for a section using Customizer JS API
- Create new product with woocommerce REST API with javascript (clientside)?
- Anyway to disable the auto excerpt creation?
- What is TypeScript and why would I use it in place of JavaScript? [closed]
- How to do associative array/hashing in JavaScript
- map function for objects (instead of arrays)
- Check if a string has a certain piece of text [duplicate]
- How to write a countdown timer in JavaScript?
- TypeScript foreach return [duplicate]
- “document.getElementByClass is not a function”
- Go back button in a page
- ‘react-scripts’ is not recognized as an internal or external command
- After $npm install, Getting Error: Cannot find module ‘../lib/utils/unsupported.js’
- What’s the best way to convert a number to a string in JavaScript?
- React Native: this.setState is not a function
- How to perform string interpolation in TypeScript?
- CSS height 100% percent not working
- Angular 4 setting selected option in Dropdown
- How can I upload files asynchronously with jQuery?
- How do I format date in jQuery datetimepicker?
- Cannot read property ‘bind’ of undefined. React.js
- Why is my asynchronous function returning Promise {
} instead of a value? - NodeJs : TypeError: require(…) is not a function
- How can I convert an image into Base64 string using JavaScript?
- Javascript checkbox onChange
- Number prime test in JavaScript
- document.getElementById not working / Display
- jQuery: Check if div with certain class name exists
- What is jQuery Unobtrusive Validation?
- CreateElement with id?
- Print PDF directly from JavaScript
- Set value of hidden input with jquery
- How does AJAX work?
- element.setAttribute is not a function
- gapi is not defined – Google sign in issue with gapi.auth2.init
- Remove all special characters with RegExp
- jQuery: Get selected element tag name
- Does ECMAScript 6 have a convention for abstract classes?
- Why is jquery show() not working in example
- console.log showing contents of array object
- How to check for an undefined or null variable in JavaScript?
- HTML anchor link – href and onclick both?
- How to use forEach loop correctly in angular 2?
- javascript push multidimensional array
- How can I know which radio button is selected via jQuery?
- jquery toggleClass not working
- Positioning element at center of screen
- Can WordPress be made to support websockets?
- How to use wp.hooks.addAction() in React JS/Gutenberg?
- Remove extra Google Maps script
- trying to enqueue script in wordpress
- single page wordpress
- initial open/toggle PluginDocumentSettingPanel panel in document setting block editor gutenberg
- Theme Customiser not live previewing changes on pseudo elements
- Instantiate TinyMCE via JS ( rather than PHP/wp_editor )
- How can I get the standard WP-Editor through Javascript?
- Gutenberg select categories
- Modal working only on home page
- AJAX not Working with php as supposed
- how to localized scripts of new page requested by ajax?
- Performance vs plugin genrated javascript
- print script on wordpress header after user registered
- Load external javascript files
- Javascript alert appears before tag
- Bootstrap bundle present in page source but not working
- Web cover page open when button clicked
- Replace script attr or link
- Remove escape characters from JSON string pulled from a database
- How to pass data to javascript in custom widget class
- Client side pre-save Javascript hook on all admin pages
- WP Gutenberg – custom block with two content fields
- How to add additional JavaScript code [duplicate]
- Contact form 7 hide and show fields depending up on the condition [closed]
- wp_enqueue has a resource but doesn’t generate a script tag [duplicate]
- Javascript not working on index.php but it is working on single post’s page
- Unable to change the location of a file
- How can I look at/edit what’s being sent to post.php when I hit the publish/update button?