You have two issues:
1.- Your are not passing the correct post ID. To solve this problem change:
update_post_meta( $post->ID, 'my_key', $mydata );
To:
update_post_meta( $post_id, 'my_key', $mydata );
2.- Your are not createing the input correctly, the name
attribute is missed:
Change:
echo '<input type="text" value="' . $value . '" id="my_id">';
To:
echo '<input type="text" value="' . $value . '" id="my_id" name="my_id">';
Related Posts:
- Update all posts automatically when using post_meta
- Better post meta efficiency?
- Guest Author – How to modify my custom function code if the guest author URL will follow a particular pattern/format?
- Human Time Diff, change mins to minutes
- Change post format using custom field
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- What Is meta_id In wp_postmeta?
- Add custom field automatically (add_post_meta) with value based on number of words of article
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- How can I sort posts by the date and a custom meta field?
- Force the “Choose from the most used tags” meta box section to always be expanded
- Cannot retrieve a custom RSS field from posts
- Customize rel=canonical tag for single blog post
- Change all author links in Blog roll
- How to I retrieve the ID from the Posts page?
- Get post meta retrieving wrong value
- if in category but only with post meta
- Saving Post Data in Another Database
- Add multiple meta keys to a post at once
- Post meta not working
- How do you update post date (year only) in a separate custom field?
- WP_Query sort by meta_value_num or date
- Check if user has avatar
- Creating Ordered Query using Meta_key
- Run function after post is updated
- How can I create a menu items from meta box based on users input
- Display a custom field rating system in the front end
- How enter custom post meta or custom field on box post list archive page?
- Two Custom Post Types Many to Many Relationship
- get_post_meta not working on publishing
- How to display the link (title) and thumbnail post?
- Show the content that is after the excerpt using child theme
- What WordPress function to use to get meta value by using meta keys?
- Automatically add custom fields value to wordpress post
- How to allow users to post only in certain category and hide elements from edit page?
- Meta value does not save for scheduled posts
- Custom Posts Query and meta_query Sort Order
- Is there a way to notify specific users when new posts are published to specific pages?
- How to do set post permalinks using 6 digit random unique function?
- Can’t get buddypress notifications in front-end; why do I get this error?
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- MySql query to get posts with all meta and terms
- Default Custom Field Value Automatically Update
- How to compare two posts including their meta fields on a scalable base?
- Categories list into registration form
- Getting value from get_post_custom
- Send post id through ajax and get the post content back
- Add a custom meta box in the post options that loads some html code in the header
- Calling Different Custom Post Timestamps in a table
- Is it possible to paste a link without tags and make it directly a link in a post?
- Display post x of y within category
- Force authors to Preview a post before publishing
- WordPress Automatic Filename Changer
- Query Posts With Over 1000 Views
- Saving custom fields to a custom taxonomy
- Hooking into the post editing screen for an existing page only
- Query Posts by Custom Field
- Redirect to another page using contact form 7? [closed]
- Order posts alphabetically: how to set order=asc in mysql query?
- How to automate featured posts number? [duplicate]
- Which PHP page is the Default Posts Page
- How to rate a post from Admin Side / Manually?
- How to save meta checkbox WordPress
- Prevent custom field from being updated after first publish
- disable Tab post on nav-menus page (Admin)
- Adding bootstrap classes to video shortcodes
- How to calculate the average of a post meta value(Numeric) of a specific author
- Every second post different class in blog view
- Format latest/newest post differently
- Get post ID from a link
- is_page Funtion for Posts ?
- Is there any way to tell when wp_postmeta has been updated?
- Create a list of posts with topic headdings
- Post type no single page
- Add field to user meta table in database when link is clicked
- Hide custom metabox value from custom fields
- Adding a user’s ID behind the tag ref link address
- wpColorPicker – problem with implementation to post meta
- The_excerpt() doesn’t parse – how to change that?
- Hide custom fields when empty
- How to only publish posts with image in it
- Isn’t the way posts are displayed very unefficient?
- Edit multiple custom post types while saving a new or edited post
- Add custom text automatically on each post
- How to check in functions.php if there is data in a WP_Query?
- Change post author without using wp_update_post()
- restrict incrementation of post vies count when refreshing the page
- Defined function isn’t showed on page
- wp_query with ajax
- Update post meta within save_post action
- WordPress 302 Redirect to Random Product/Post/Page
- Display post number by category
- Output Post with ACF Fields into other Post
- Updating post meta for checkbox
- Getting Whitescreen when publishing a post [closed]
- Using system date format
- Get post by tag
- Add code to a specific post’s content
- Related Posts function not working