New answers tagged

0

A more reliable way of checking is to get $_POST['original_publish'], as that will return 'Publish' on first publishing it, and 'Update' on updating it.


0

One approach is to use get_post_status() According to the codex http://codex.wordpress.org/Function_Reference/get_post_status 'publish' - A published post or page 'pending' - post is pending review 'draft' - a post in draft status 'auto-draft' - a newly created post, with no content 'future' - a post to publish in the future 'private' - not visible to ...


1

The use of header() function produce output in the middle of the request and crash it. To modify uploaded image you should use wp_handle_upload filter instead of save_post action. Also, ideally, you should use WP_Image_Editor class, which will use the best image manipulation library available in the server (GD, Imagemagick) and triggers several filters and ...



Top 50 recent answers are included