you can do with jquery like:
<?php global $current_user;
get_currentuserinfo();
echo 'Username: ' . $current_user->user_login . "\n";
echo 'User email: ' . $current_user->user_email . "\n";
echo 'User level: ' . $current_user->user_level . "\n";
echo 'User first name: ' . $current_user->user_firstname . "\n";
echo 'User last name: ' . $current_user->user_lastname . "\n";
echo 'User display name: ' . $current_user->display_name . "\n";
echo 'User ID: ' . $current_user->ID . "\n";
?>
first get all login user data and then get contact form field id like #unsemae
$("#unsemae").val("<?php echo $current_user->user_login ;?>");
Thnk you
Related Posts:
- How to make a script load after Custom Block is loaded in the editor?
- Can I disable the auto complete?
- When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?
- simple expandable vertical menu, java script problem
- How to use get_option() without any filter?
- dynamic external javascript generated using php
- Widget Javascript code (ajax)
- How to link external JavaScript files?
- add JS to multiple plugin admin pages
- Create simple Cookie Box for WordPress
- how to add custom css and js on wordpress post editor directly without using .php file
- Javascript Solution Remove Specific Tag but leave the rest in a specific DIV
- window resizing problem
- Contact From 7 Custom Validation Issues
- Load MediaPlayerElement after Infinity Scroll loads more posts
- Include custom JS without child theme
- Custom Login Process
- Salesforce lead tracking with contact forms plugins [closed]
- buddypress remove username from autocomplete
- Upload a web module (html and JS) to wordpress
- Remove welcome panel from contact form 7 page [closed]
- How to add WordPress JS Script Links
- custom css and javascript not working on page defined as template?
- wp_enqueue_script JS code runs too late (after user begins interacting)
- Conditional Logic on CF7 dropdown options
- custom email validation using javascript api with elementor pro and code snippets
- javascript file not working in a plugin template file
- Javascript Tooltip not fully working on my wordpress page
- Where to put coding a validation script for store? [duplicate]
- WordPress Customizer: Check for value of CSS selector and replace it
- Contact form 7 ajax response true/false based on some condtion
- How to submit form data in the same page in WordPress without reloading the page?
- How to implement custom Javascript to my site
- Multi-site customization
- Pass the post ID
- Document.body.scrollTop in WordPress
- Adding Custom HTML/CSS/JS code in specific page
- Making custom pages (with an example to explain the goal)
- Prevent posts from being published if the ‘Uncategorized’-category or no category is selected
- Particle.js not loading in WordPress Gutenberg
- Multi color post title by using custom javascript inside the gutenberg editor?
- Customizing the Subject Field in WordPress’ Notification Emails?
- How to move wp-content (or uploads) outside of the WordPress directory
- How can I integrate pages written in something other than PHP?
- Custom field values in permalink
- Redirect to requested page after (custom) login
- Custom protected password page with ACF
- Page load requires a trailing “/” [closed]
- Show Custom Taxonomy Slug(s)?
- What’s the proper way to use a custom table? [closed]
- How to retrieve the value stored in a multi-dimensional array and SUM the entries?
- Integrate WordPress into existing website
- How can I use get_bloginfo(‘admin_email’) in a custom PHP file?
- Turn off redirect to canonical domain (or host website on any hostname)
- CSS to remove “comments count” icon from main page [closed]
- What’s wrong with Customizing new user notification email by add_filter?
- Automatically Update Woocommerce Prices [closed]
- Multiple Tinymce/wp_editor in WordPress >4.8
- CPT Loop with ACF and passing ID between Loops
- Showcase elementor templates
- No shipping method has been selected [closed]
- How to add a do_action on refreshing of WP customizer?
- How can I setup up an a pre-populated pdf based on what was entered? [closed]
- Organizing the position of widgetized areas in the backend
- Get wordpress taxonomy slug name(s) to use as div class
- Why does my Posts page only show a single post when using Thematic?
- add custom content to appearance/widgets screen
- How to create a page /1 using ?
- Open “Visit site” in a new window?
- What’s the right way to share data between widgets?
- Importing specified data/field
- Missing current_page_item in custom menu
- Attach File Funcion for Common people
- How to retain visual breadcrumbs w/ tricky URL structure? Custom post template?
- Mimicking admin panel menu from wordpress 3.0.1
- query variables for custom taxonomies
- Adding overlay search to wordpress using add action/filter
- wordpress custom fields loop
- why won’t my custom css load with the enqueue method or any other method?
- How do I add a dropdown menu to a form?
- Adding a drop-down (select tag) option under Menu Settings in WordPress Admin
- POST 429 Error when trying to place more than 20 images into post at once
- Issue with navigation bar in child theme
- How to add rewrite rule for product compare page?
- How to add custom Author Info Box to blog posts “only” and NOT custom post templates
- Bio comes up when the visitor clicks on a picture
- Accountless password generation
- Creating a Treeview Listing of a Directory
- WooCommerce – Adding custom HTML to specific product pages
- How to create new page can get custom field other post in wordpress
- insert autofocus in a custom taxonomy form
- display my pages html
- customize footer widgets area
- Accessing + retrieving custom database in WordPress
- updated permalink structure on localhost does not work
- Replacing & in JS code on pages
- adding new html css to wordpress section from codepen [closed]
- Changes to code not displaying
- Permalink Listing WordPress
- Has the table name in SQL for WordPress changed from WP_posts to WPCS_post?