save_post Hook Firing When I move the post on trash
-
Hi, I Want To Call Function When My Reserved Post Type is Modified So I Used save_post Hook and I Completed Everything But After I Found This Bug That When I Move The Post It Call The Save Post Hook But I don’t Want This.I Want This For Only When The Post Is Inserted or Modified. I Tried With wp_insert_post And Tried $post->post_status !== ‘trash’ And $_[‘POST’][‘action’] !== ‘trash’ But It Don’t Work.The Hook Is Triggered When I Try To Move The Post In Trash .
add_action("save_post", [$instance,'save_metabox'],10,3);
The page I need help with: [log in to see the link]
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘save_post Hook Firing When I move the post on trash’ is closed to new replies.