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
- Make Google index the entire post if it is separated into several pages
- get_query_var function not working at all
- How to correctly escape query variables to be used in WP_Query
- paginate_links ignore my format
- How to pass on Google Adwords gclid variable to other pages
- Remove Google Fonts Which Are (Probably) Added By Plugins
- 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
- Feed 404 Errors
- Query two taxonomies via URL or link?
- Correct way to hide pseudo pages from being shown?
- Does wordpress insert automatic google analytic?
- I can’t fetch query parameters ($_GET parameters) with get_query_var
- How to add query parameters to all internal links?
- Passing Variable as URL Parameter — Security concerns?
- Custom permalink with pagination
- Enqueue Script with URL parameters
- add_rewrite_rule not working for page var
- Pagination Doesn’t Work
- Custom Rewrite with Query vars
- Rewrite Rule for Custom Page with Query Vars in URL
- WordPress query through Products variation stock [closed]
- set_query_var doesn’t seem to work on init hook
- how to hide specific post from google search
- 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?
- Determine WP_Query parameters from URL
- What does query_var do in register_taxonomy
- How to stop a 500 error on the WordPress theme folder
- WordPress rewrite rules for state and city
- Rewrite rules and query for virtual page
- Passing array of strings to a SQL statement in a WordPress plugin
- My WordPress Blog sends malicious traffic to other sites [closed]
- How to Modify Existing Rewrite Rules?
- Rewrite URL Parameter And Force ‘Pretty’ Permalink
- Change Theme from Plugin based on query_vars
- How to make WordPress audio playlist understand the direct links of audio files shared on google drive?
- How to implement Google reCaptcha without installing a plugin?
- Why query_vars get altered in WP_Query Object?
- Is there a plugin to record querystring parameters for a page (for customer tracking)? [closed]
- Looking for a solution – slightly convoluted problem
- Taxonomy page template changing when using query variables
- Custom Post for Locating by Google Maps API
- Is it safe to use $_POST directly in my plugin instead of using admin-ajax.php to receive data from ajax?
- add_rewrite_rule query_var not being set
- WordPress query vars are not added
- Show only IF not Google bot [closed]
- Unfamiliar query string in Google Search Console URL not found
- Variable in Array Not Working
- Disallow author with robots.txt
- WordPress categories being called “archives” in google links. How to remove?
- Adding JSON Structured Data to WordPress
- Rewrite rule to prettify two $_GET variables while in a new endpoint from a page
- Rewriting get_next_posts_link() for custom loop
- Using google graph api with wordpress
- Is there a way to avoid 404 pages in WordPress?
- How to implement Google Tag Manager? [closed]
- Adding to fontawesome-webfont.woff2 to boost website speed
- Changing WP_Query params with url Query Var
- 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
- query_vars filter not working even though query string parameter is present
- Custom query var rewriting with only variable
- 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?
- WordPress Google Calendar Oath 404
- Block google maps from loading until user agrees to cookies with Elementor
- Google Tag Manger – no-script Code Not Found
- How To Fix 404 errors caused by Google Indexing WordPress In Subdirectory
- WP-Stateless: Multi Regional Vs Regional Storage
- Redirect Uploads Folder to Query Vars in WordPress
- Custom taxonomy rewrite with query var returns %2F in URL
- add_filter(‘query_vars’) not working in custom template
- Get query parameters from external url and make a redirection
- add_rewrite_rule permalinks break in WordPress 4.5
- Add Adsense to a website but the server responds with error 510 [closed]
- How can I disable all external url Google in WordPress backend?