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

WordPress Trac noreply at wordpress.org
Tue Dec 26 12:32:27 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 mklasen):

 Just ran into this myself.

 1. Create new CPT post in dashboard
 2. Enter post title + metadata in CMB2
 3. Save.

 When hooking into save_post with priority 90, the get_post_meta($id)
 return is:
 {{{#!php
 array(1) { ["_edit_last"]=> array(1) { [0]=> string(1) "1" } }
 }}}

 When hooking into save_post_{$post->post_type} with priority 90, the
 return is:
 {{{#!php
 array(4) { ["_edit_lock"]=> array(1) { [0]=> string(12) "1514291087:1" }
 ["_edit_last"]=> array(1) { [0]=> string(1) "1" }
 ["_custom_meta_value_1"]=> array(1) { [0]=> string(5) "test1" }
 ["_custom_meta_value_2"]=> array(1) { [0]=> string(5) "test2" } }
 }}}

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


More information about the wp-trac mailing list