42 lines
949 B
PHP
42 lines
949 B
PHP
<?php
|
|
|
|
/*
|
|
* it means someone outside wp is accessing the file, in this case kill it.
|
|
*/
|
|
if (!defined('ABSPATH')) {
|
|
die('You can not access this file!');
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
* add a schedule event to delete this order_id
|
|
* after 3 days ?
|
|
* time() + 60 = one minute from now
|
|
* time() + MINUTE_IN_SECONDS = one minute from now
|
|
* -> https://codex.wordpress.org/Easier_Expression_of_Time_Constants
|
|
* -> also strtotime : https://www.php.net/manual/en/function.strtotime.php
|
|
*
|
|
*/
|
|
//function schedule_delete_orderid_CIPF($user_id, $order_id) {
|
|
// PLGNTLS_class::debug_infos();
|
|
// $delay = time() + MINUTE_IN_SECONDS;
|
|
// wp_schedule_single_event($delay, 'orderid_deletion_event_CIPF', array($user_id, $order_id));
|
|
//}
|
|
//function delete_order_id_later_CIPF($user_id, $order_id) {
|
|
// PLGNTLS_class::debug_infos();
|
|
// delete_user_meta($user_id, 'cipf_order_id', $order_id);
|
|
//}
|
|
//add_action('orderid_deletion_event_CIPF', 'delete_order_id_later_CIPF', 5, 2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
?>
|