check if a draft has been moved there from publish to draft

As far as I can see, you won’t get any indication a post was previously published, as wordpress remembers only the old versus new transitions. I recommend you add some meta data, that is use add_action(‘publish_post’, ‘your_function’) (or similar) to do update_post_meta($post->ID, ‘post_published’, ‘on’). That way, every post gets an indicator when it’s published – … Read more

Tracing dashboard publish settings from input form in WordPress

Those are some dangerous words “public…can enter data directly to the DB” You could write your own form and use wp_insert_post() Something like this: $new_post = array( ‘comment_status’ => ‘closed’, ‘ping_status’ => ‘closed’, ‘post_author’ => 1, // id of admin, or some other user ‘post_title’ => $_POST[‘title’], ‘post_name’ => $_POST[‘title’], ‘post_status’ => ‘draft’, ‘post_type’ => … Read more

Change event firing in wordpress

Using transistion_post_status I’m able to retrieve post meta. add_action( ‘transition_post_status’, ‘post_published’, 10, 3 ); function post_published( $new_status, $old_status, $post ) { if ( $old_status != ‘publish’ && $new_status == ‘publish’ ) { $meta = get_post_meta($post->ID); echo ‘<pre>’; var_dump($meta); echo ‘</pre>’; die(); } }