I am using wordpress and woocommerce, and I have a code for auto complete processing order, but the php was executed twice at the same time, and it causes some problems, is there any method I can avoid this, like is there a function for php like setTimeout in js? will it works? https://prnt.sc/R-ygNBOtkVqh
The code:(a very simple code)
add_filter( 'woocommerce_payment_complete_order_status', 'bbloomer_autocomplete_processing_orders', 9999 );
function bbloomer_autocomplete_processing_orders() {
return 'completed';
}