We have a script, the bare bones of which are this:
//Auto add and update Title field; send the APP message and emails, etc.
function my_post_updater( $post_id ) {
// this fires it only on saves (and not revisions)
if ( ! wp_is_post_revision( $post_id ) ){
// unhook this function to prevent infinite looping
remove_action( 'acf/save_post', 'my_post_updater', 20 );
// LOADS OF CODE TO PROCESS THE POST
// rehook this function to prevent infinite looping
add_action( 'acf/save_post', 'my_post_updater' );
}
}
add_action('acf/save_post', 'my_post_updater', 20);
It’s been working fine when accessed from my PC for ages now. No problems at all. And it works fine from my PC now still.
However, if we use another laptop then SOMETIMES it will send duplicate posts.
Is this a problem with the laptop? Is there a way we can adjust the code to stop this? Has anyone got ANY idea at all how to solve this?