/** * Stop & reset any Product Set updates. */ function dfrps_reset_update() { global $wpdb; // Get currently updating product set ID. $set_id = $wpdb->get_var("\n\t\tSELECT post_id \n\t\tFROM {$wpdb->postmeta}\n\t\tWHERE meta_key = '_dfrps_cpt_update_phase'\n\t\tAND meta_value > '0'\n\t"); if (!is_null($set_id)) { dfrps_reset_product_set_update($set_id); } }
/** * Set the next update time to 5 minutes in the future so a user has time Restore * this product set from the Trash. * * Also, reset update phase back to 0. This prevents the set from being ignored if * the phase is greater than 2, as the delete function only has 2 phases. (#8705) * * Also, delete first_pass information. */ function wp_trash_product_set($post_id) { $this->trashed_set_id = $post_id; update_post_meta($post_id, '_dfrps_cpt_next_update_time', date_i18n('U') + 300); dfrps_reset_product_set_update($post_id); }