If you want to output the $id
, you need to echo.
Also be sure to use esc_attr()
as a good security practice.
<input type="hidden" name="id" value="[insert_php]echo esc_attr( $id );[/insert_php]">
In addition, as was noted in another answer, you’re calling it an ‘id’, but you’re actually using the login (username). If all you need is the numeric ID, use get_current_user_id()
.
<input type="hidden" name="id" value="[insert_php]echo esc_attr( get_current_user_id() );[/insert_php]">
Related Posts:
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Adding data to custom wordpress database table
- Insert data from form to database
- Custom form that stores data in mysql database
- Putting form result in my database
- Can’t insert into a database wordpress
- How to return number of found rows from SELECT query
- How to correctly submit a search form and display the result in an independent page
- Check if post of title already exists
- $wpdb->delete column values IN ARRAY()?
- How To Make Connection To WordPress Data Base In A Plugin?
- Has anyone tried putting PHP ActiveRecord on WordPress?
- Changing user_nicename
- Does WordPress cache get_user_meta() results?
- WordPress will not operate correctly
- How to Join two tables from separate databases within WordPress
- error importing localhost export file to server
- Would manually deleting the dumping data fix a “#1062 – Duplicate entry ‘1’ for key ‘PRIMARY'” phpMyAdmin error?
- How to sort results from a custom database table
- How can I call a row of user specific data from a custom table added to the WP Database
- How to merge local and live databases?
- How to track a users progress through pages by inserting data into WordPress Database?
- Import 10,000 Users into WordPress WITH a specific ID for each user
- WP database error for comments_popup_link()
- if statement on database query
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- No wp-config.php file on local install of wordpress – site still displays
- How to migrate the posts from an old custom legacy blog to a new WordPress website?
- Different database query in function.php using mysqli
- Adding Custom Forms
- Create WP_Query to search for posts by their categories or their parent/child categories
- WordPress not reflecting changed of the database
- How can I save unique user data on my site? [closed]
- Update results, Before deleting the related category [closed]
- database sent to a JSON file
- inserting a post from an extern php file but post content doesn’t show on wp site
- Using custom tables for old posts
- Databases – Submitting data from inputs to database [closed]
- db converts decimal number wrong
- Not connecting to database in file with multiple MySQL connections
- WordPress Block developer from exporting Database via PHP
- wpdb prepare insert table doesn’t work
- Should I use WordPress to skin a database website?
- How do I display offsite database info on my wordpress site?
- Creating Database Table vs. Adding MetaData to Post & User
- WordPress and MySQL: trying to print data using PHP from user_meta custom field data
- Most commented posts by time period (last 12h, last 24h and etc)
- I can’t update my data through $wpdb
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Get wp_current_user_id using PHP and MySQL
- form $_post action value gets truncated after it passes through two forms
- WPDB secure custom form
- Why when I create a new post I found 2 record related to this post into the posts database table?
- phpMyAdmin error #1062 – Duplicate entry ‘1’ for key ‘PRIMARY’
- Add row to custom database Table and delete all rows older than 1 day
- select a single val though a table in wordpress
- SQL error with custom query
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- What’s wrong in my PHP code? I’m using WordPress Astra Theme and I can’t insert data into my SQL
- Please help! I have a problem with getting wordpress databas
- Error establishing a database connection (Set-up locally)
- $_POST returning empty values
- How to send custom form submissions to WordPress Database?
- PHP Warning: mysqli_query(): after updating my websites php from 5.6 to 7.2
- Confuse between forms and tables
- Using wpdb to connect to a different database is not working
- Updating the database after parsing CSV document
- custom search query database in child theme
- can’t delete a row from post_meta table
- Processing forms with php to wordpress database
- How to set max users to 17.000
- Passed variable gets undefined variable error on insert on next page
- How to set up an auto delete post?
- two wordpress sites, two themes, one database, same content
- Insert double entry in DB
- How to connect database table to each registered wordpress user.
- Let users register weight each day and save it in DB
- MySQL database migration to WordPress
- Custom query_posts() parameter
- How to edit the default database of WordPress [closed]
- Display total count of products in orders of a specific order status
- Execute multiple PHP Snippets causes error?
- Bulk data save in custom table
- Metabox repeating fields – radio buttons not saving correctly
- How to handle a custom form in wordpress to submit to another page?
- Use ajax to update_post_meta
- Getting the dropdown menu to redirect to different pages?
- WSoD being caused by this piece of code
- How to display data from custom table in wordpress phpmyadmin
- Replacing mysql_escape_string in a custom plugin when moving to PHP7
- Weird 404 URL Problem – domain name being placed at end of urls
- Styling my own password protected page, how to deal with wrong password?
- Mixing variables into an array when inserting values
- Using admin-post.php for admin form but it directs me to admin-post.php white screen
- Convert a column of a table containing an Array as response in HTML
- Limiting posts based on nested meta_query
- Updating user meta adds string count to value?
- WAMP SERVER Command Prompt SET PATH=%PATH%
- Create an unique ID number after submit form
- How to get the last date updated of postmeta?