do_action( 'wp_trash_post',
$post_id );
add_post_meta( $post_id, '_wp_trash_meta_status',
$post->post_status
);
add_post_meta( $post_id, '_wp_trash_meta_time',
time() );
$old_status =
$post->post_status;
$new_status = 'trash';
$wpdb->
update( $wpdb->posts, array
( 'post_status' =>
$new_status ), array
( 'ID' =>
$post->ID
) );
clean_post_cache( $post->ID
);
$post->post_status =
$new_status;
wp_transition_post_status( $new_status,
$old_status,
$post );
/** This action is documented in wp-includes/post.php */
do_action( "edit_post_{
$post->post_type
}",
$post->ID,
$post );
/** This action is documented in wp-includes/post.php */
do_action( 'edit_post',
$post->ID,
$post );
/** This action is documented in wp-includes/post.php */
do_action( "save_post_{
$post->post_type
}",
$post->ID,
$post, true
);
/** This action is documented in wp-includes/post.php */