Automattic\WooCommerce\Blocks\Patterns

PTKPatternsStore::is_older_than_one_dayprivateWC 1.0

Check if the last request was more than one day ago.

Method of the class: PTKPatternsStore{}

No Hooks.

Returns

true|false.

Usage

// private - for code of main (parent) class only
$result = $this->is_older_than_one_day( $last_request );
$last_request(int) (required)
The last request time.

PTKPatternsStore::is_older_than_one_day() code WC 10.3.6

private function is_older_than_one_day( $last_request ) {
	$current_time = time();
	return abs( $last_request - $current_time ) > DAY_IN_SECONDS;
}