Tag Info

New answers tagged


There are two flaws in the code that I can see. The first one is a bug in this code if($post->post_type != 'product') If no post exists, you get the following error Notice: Trying to get property of non-object... This can be fixed by first checking if a post isset if(isset($post) && $post->post_type != 'product') Secondly, ...


save_post is actually called on saving a post through the Quick Edit feature as well. As we find from the source code, the save_post action is called from two functions: wp_publish_post and wp_insert_post, the latter being called both when saving a post through the normal process and when saving a post through the quick edit process! So, the code as you ...

Top 50 recent answers are included