WC_Product_Usage_Notice::is_remind_later_clicked_recently()
Check whether the user clicked "remind later" recently.
Метод класса: WC_Product_Usage_Notice{}
Хуков нет.
Возвращает
true|false
.
Использование
$result = WC_Product_Usage_Notice::is_remind_later_clicked_recently( $user_id, $product_id ): bool;
- $user_id(int) (обязательный)
- User ID.
- $product_id(int) (обязательный)
- Product ID.
Код WC_Product_Usage_Notice::is_remind_later_clicked_recently() WC Product Usage Notice::is remind later clicked recently WC 9.4.2
private static function is_remind_later_clicked_recently( int $user_id, int $product_id ): bool { $last_remind_later_ts = absint( get_user_meta( $user_id, self::REMIND_LATER_TIMESTAMP_META_PREFIX . $product_id, true ) ); if ( 0 === $last_remind_later_ts ) { return false; } $seconds_since_clicked_remind_later = time() - $last_remind_later_ts; $wait_after_remind_later = self::$current_notice_rule['wait_in_seconds_after_remind_later']; return $seconds_since_clicked_remind_later < $wait_after_remind_later; }