Timeline for Custom Post Status Transition Issues With Get Post Meta
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 2, 2016 at 5:59 | comment | added | bynicolas | I'm also thinking, do you have another method that saves that post_meta: _bananas_email? | |
Aug 2, 2016 at 5:54 | comment | added | bynicolas | Edited the code to correct my typo on the $post->post_status. Also added a check for update or not. if $update is true, return (or exit) so you don't always run the code on every save. As for the meta being blank, you can't save a meta to a post BEFORE that post being created because you need the $post_id to save that post_meta. so what you are trying to achieve is not possible. Is _bananas_email the email of the user you want to notify or just a meta to keep track of email notifications? | |
Aug 2, 2016 at 5:44 | history | edited | bynicolas | CC BY-SA 3.0 |
Corrected post_status error and update check
|
Aug 1, 2016 at 23:37 | comment | added | JediTricks007 | Hey thanks but this code won't work I do not think. Theres a few things wrong. $post->status should be $post->post_status. This code will run on every update after a post is published which won't work. And the meta is still blank. | |
Aug 1, 2016 at 21:32 | history | answered | bynicolas | CC BY-SA 3.0 |