Hi @jamiechong
Thanks for your reply.
I’m using this action from “WP All Import” plugin to check if the post will be updated during the import process. I’m trying to schedule imported (only updated) posts.
function my_is_post_to_update( $continue_import, $post_id, $data, $import_id ) {
...
$post = get_post($post_id);
Revisionize\create_revision($post, true); // create a revision of the original post
// Getting Revision ID
$new_id= how_to_get_id_of_the_revision(); // << THIS
$post = get_post($new_id); // Geting post object
$post->post_date_gmt = $postdate_gmt; // defined earlier
$post->post_date = $postdate; // defined earlier
wp_update_post( $post ); // Update the revision with scheduled dates
...
}
add_filter( 'wp_all_import_is_post_to_update', 'my_is_post_to_update', 10, 4 );
Thank you
-
This reply was modified 5 years, 8 months ago by
charafweb.