[wp-trac] [WordPress Trac] #41751: save_post_{custom_post_type} not behaving exactly as save_post

WordPress Trac noreply at wordpress.org
Wed Aug 30 14:20:26 UTC 2017


#41751: save_post_{custom_post_type} not behaving exactly as save_post
-------------------------------+------------------------------
 Reporter:  dipakbbsr          |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:  4.8.1
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:  administration
-------------------------------+------------------------------

Comment (by subrataemfluence):

 Welcome to Trac and thanks for the ticket!

 Did you create this custom post type by hand using `register_post_type`?
 If yes, how are you handling `meta_boxes` for storing meta values against
 a post?

 ''"But when same code is written inside `save_post_{custom_post_type}`
 action, the meta fields that are originally save to a post are coming. But
 the meta fields that are being updated in the post are not coming."''

 From above I assume you are able to update meta values somewhere, most
 likely in admin, but updated values are not showing up? Are you sure
 whether these values are actually getting updated?

 You said your post is being saved as Draft in front end and being
 published from back end. When you update the values please can you check:

 1. New values are being saved in database? Can you check into
 `wp_post_meta` table using the `post_id`? Can you see the updated values
 against the original post id?
 2. It is not creating a revision.
 3. Does the status of original post change to Publish when you do this
 from admin?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41751#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list