#22241 closed defect (bug) (invalid)
inconsistence with transition_post_status with CPT
Reported by: | thomask | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
im playing with transition_post_status filter and it seems it returns different values for posts+pages and for custom post types - for posts and pages it hase those values:
new_status:inherit
old_status:new
and the $post is the auto draft. Then this function is called twice, secondly for the saved post with new post status
for CPT it returns the actual old status and new status and $post is the actual post and it is called just once
actually I prefer the way it works for CPT as it actualy returns the old and new post status, what should be the proper function. But it seems, that the problem is somewhere deeper, e.g. that you are saving posts&pages twice, but not doing it for CPT
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hey there! You mentioned you were playing around with the code, can you please post some of it to better understand and reproduce the bug? Judging from the code in
wp_insert_post
, I don't really see howwp_transition_post_status
would differ between built in post types and custom post types. I might be overlooking some things. Thanks!