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?
- How to check if post meta key exists or not in wordpress database
- List only child categories a post is in, of a specific parent category
- Setting post meta data to random value during post status transition / on publish
- Add custom field to all posts in specific category
- How to change post status from publish to draft using hook in wordpress?
- How can update custom meta for all posts
- Allow role to delete posts but block him the wp-admin
- Why does `url_to_postid` return 0 when testing `page_for_posts` Page?
- WP_Query in functions.php overrides global $post object, even with wp_reset_query()
- How to add a custom field after wp post
- Only display posts after current date
- How can I get a post field value using javascript?
- Ajax posts filter by date, comments, top views, top likes
- Prepend or add an Image to the content of a Post
- Guest Author – How to display posts on /author/ archive page
- Two Custom Post Types Many to Many Relationship
- What WordPress function to use to get meta value by using meta keys?
- How to do set post permalinks using 6 digit random unique function?
- Getting value from get_post_custom
- Display post x of y within category
- WordPress Automatic Filename Changer
- Redirect to another page using contact form 7? [closed]
- How to automate featured posts number? [duplicate]
- How to save meta checkbox WordPress
- Prevent custom field from being updated after first publish
- Adding bootstrap classes to video shortcodes
- Create a list of posts with topic headdings
- Add field to user meta table in database when link is clicked
- Hide custom metabox value from custom fields
- Hide custom fields when empty
- Add custom text automatically on each post
- Custom permalink for each post
- How can I tell if a post has been published at least once?
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- Is there a way getting post fields using `transition_post_status`
- After ajax image is outside the “ tag
- Edit custom fields in posts list
- Is it advisable to use $post->comment_count instead of get_comments_number( $post_id )
- Related Posts: Changing Function For Posts Per Page
- WP_Query custom field pass the post id
- Retrieve data from post meta meta_key having ‘_product_fq_image’ while having author_id and post type is PRODUCT
- Adding a meta box to determine the sidebar [closed]
- If custom field is empty, use one from a previous post
- Why my meta boxes won’t show in front post page?
- Making a wordpress page print friendly
- Automate post update for all posts?
- Set Default Post as Parent Child (Nested) Relation
- I need to create “View Profile” and “Edit Profile” links by incorporating the Post Title/ID, but can’t seem to manage it
- Only the most recent post is showing on my category page (working on localhost, not live site)
- Post picker custom field on page
- Featured Images most often doesnt appear
- How to bulk Update URLs to new values?
- WordPress Sticky Post Count “Fix” Breaking Pagecount by 72 pages!
- How to retrieve all meta data directly from the $post object? Such as $post->related_topics?
- I want to change the WordPress comments file
- Excluding tag Link from html tags in Post content
- Changing a users posts to drafts upon role change
- Show all posts from the tags without having to set all of them
- Trim excerpt to first paragraph
- post_name is not stored until post is published… where should I store my slug until it goes live then?
- How to retrieve a post by inputing the url in a custom field and displaying it on an options page
- Custom fields in normal posts
- Show posts between two Custom Fields date
- Ordering posts alphabetically by meta keys and title
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- How to limit the number of results for all query_posts on mysite
- User driven content problems
- get_post_meta property of non object
- How do we display a certain category type on a page while hiding all others?
- If meta_key exists then don’t select this post?
- What function does the loop of displaying posts?
- Site ‘Categories’: save an admin global setting with post metadata [closed]