bsf_time_since_last_versioncheck( int $hours_completed, string $option )
BSF time since last version check.
Description
Parameters
- $hours_completed
-
(int) (Required) Hours completed.
- $option
-
(string) (Required) Option.
Return
($url.)
Source
File: admin/bsf-core/includes/helpers.php
function bsf_time_since_last_versioncheck( $hours_completed, $option ) { $seconds = $hours_completed * HOUR_IN_SECONDS; $status = false; $last_update_timestamp = (int) get_option( $option, false ); if ( false !== $last_update_timestamp ) { // Find seconds passed since the last timestamp update (i.e. last request made). $elapsed_seconds = (int) current_time( 'timestamp' ) - $last_update_timestamp; // IF time is more than the required seconds allow a new HTTP request. if ( $elapsed_seconds > $seconds ) { $status = true; } } else { // If timestamp is not yet set - allow the HTTP request. $status = true; } return $status; }
Expand full source code Collapse full source code View on Trac