WC_Product_Usage_Notice::ajax_remind_later
AJAX handler for "remind later" action of product usage notice.
Method of the class: WC_Product_Usage_Notice{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = WC_Product_Usage_Notice::ajax_remind_later();
WC_Product_Usage_Notice::ajax_remind_later() WC Product Usage Notice::ajax remind later code WC 10.4.3
public static function ajax_remind_later() {
if ( ! check_ajax_referer( 'remind_later_product_usage_notice' ) ) {
wp_die( -1 );
}
$user_id = get_current_user_id();
if ( ! $user_id ) {
wp_die( -1 );
}
$product_id = absint( $_GET['product_id'] ?? 0 );
if ( ! $product_id ) {
wp_die( -1 );
}
update_user_meta( $user_id, self::REMIND_LATER_TIMESTAMP_META_PREFIX . $product_id, time() );
wp_die( 1 );
}