You are missing the ‘echo’
userfullName = <?php $current_user->display_name;?>
should be
var userfullName = "<?php echo $current_user->display_name;?>"
AND notice that I put quotes around that too.
BUT!!!!
You should really look at using wp_localize_script for declaring javascript variables.
Example:
add_action('wp_enqueue_scripts', 'fobu_front_scripts');
function fobu_front_scripts() {
global $blog_id;
$params = array(
'site_url' => site_url(),
'blog_id' => $blog_id
);
wp_localize_script( 'jquery', 'MyScriptParams', $params );
}
Related Posts:
- Google saying is blocked by robots.txt without robots.txt on my website
- Google Adwords Tracking Code causing too many redirects error
- Google maps .gm-style div now displays as block, thus breaking the map
- Rich Snippets for WordPress
- Automatically post to Google+ on new post
- Remove Query String from Google jQuery
- How to remove Google Analyticator in WordPress site?
- Google disapproved Ads due to malware, but no malware in site? [closed]
- Old robots.txt file not changing, can’t update to the current robots.txt
- Google Apps Domain for WordPress
- How to fetch csv file and show in shortcode
- How to download finished WordPress project from Google Cloud?
- How find what plugins load google Font and block it
- How to non index my website page links?
- How can I modify a post depending on the source of the traffic?
- Google is unable to crawl Robots.txt file of my website and please help me
- paginate_links ignore my format
- How to pass on Google Adwords gclid variable to other pages
- Pass custom fields values to Google Maps
- Filtered query_vars becomes global. Why does this work?
- Search custom post type by meta data
- Custom query_var causes displaying posts archive on front page
- Query two taxonomies via URL or link?
- Correct way to hide pseudo pages from being shown?
- How to add query parameters to all internal links?
- Enqueue Script with URL parameters
- add_rewrite_rule not working for page var
- Pagination Doesn’t Work
- use query var argument as verification link?
- Is there a way to stop WP editor deleting
- Google Places API With ACF [closed]
- query_vars Filter: Would You Ever Use It When $_GET is Available and You Don’t Need a ‘Pretty’ URL?
- How to stop a 500 error on the WordPress theme folder
- Change Theme from Plugin based on query_vars
- How to implement Google reCaptcha without installing a plugin?
- Is there a plugin to record querystring parameters for a page (for customer tracking)? [closed]
- WordPress query vars are not added
- Show only IF not Google bot [closed]
- Variable in Array Not Working
- WordPress categories being called “archives” in google links. How to remove?
- Adding JSON Structured Data to WordPress
- Using google graph api with wordpress
- Adding to fontawesome-webfont.woff2 to boost website speed
- media sideload image and Google Content
- how to add rewrite rule to wordpress default post type
- get_query_var returns wrong default value
- get_query_var not working for subdirectory
- get_query_var not works
- Custom rewrite_rules – only pass numbers and not alphabetic characters
- For using google api is it necessary to install the google client libraries for using Oauth 2 in wordpress installation?
- Block google maps from loading until user agrees to cookies with Elementor
- How To Fix 404 errors caused by Google Indexing WordPress In Subdirectory
- WP-Stateless: Multi Regional Vs Regional Storage
- Custom taxonomy rewrite with query var returns %2F in URL
- Get query parameters from external url and make a redirection
- Restrict access to content in conjunction with facebook connect & google login
- Google Apps SMTP for WP MultiSite?
- Excerpt formatting for Google News Feed [closed]
- Fall Back Google CDN in JavaScript
- How to unset a set query variable?
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- How do I pass custom shortcode-extracted variables (taxonomy) into a query function for WordPress RoyalSlider?
- Any idea why Google not caching my site? [closed]
- Rewrite Rule for Post Meta
- Stop wordpress from requesting external jquery from googleapi
- Getting 400 Error: redirect_uri_mismatch when trying to grant permission to Gmail SMTP plugin
- Force Rewrite Query Var On Hierarchical (Nested) Page
- How to pass menu slug as a variable to wp_nav_menu?
- Pinging or sitemap plugin: which practice is better
- Custom post types and custom variables — add_rewrite_tag() not working
- How can I receive uploaded attach file as a Google drive link [closed]
- Creating an alternate path for a page
- Query vars to return the homepage
- How to add height and width to images on a page(using WP Bakery) to improve Google’s CLS score?
- How to allow WordPress to recognize a custom URL segment after a product URL and use a custom template?
- How to force one script to load before google tag manager script
- Configure WordPress to Use Responsive Image Rendering
- How can I get custom post types to recognize pretty permalink variables?
- WordPress generates weird permalinks
- Why does a header location on admin_head remove the query var I’m setting in the location?
- WordPress pass url to page template when page does not exist
- How to include a query_vars value in document_title_parts?
- Display posts on a map
- WP CLI – Pass Query / URL Variable to Cron?
- Own query vars are not displayed
- Change default query parameters
- Pretty Filter URL
- WordPress URL question
- How do I add a class to all sidebars to let a Google Custom Search Engine know not to index the content?
- Query var SEO URL
- passing javascript variable into php wordpress
- Redirect if string found in URL
- Google adsense stats plugin? [closed]
- How can I add a google play badge to my header and footer?
- query_vars category_name only display one catgory out of multiple categories
- $_GET vs get_query_var()
- Need help with regex
- I want to lists posts in wordpress to nearest location entered by the user
- query_vars doesn’t return query string (trying to get data from $wpdb)
- I had removed my phone number from my website footer, but months later it still appears once I look it up on google, how to remove it?