Automattic\WooCommerce\Admin

WCAdminHelper::get_wcadmin_active_for_in_seconds()public staticWC 1.0

Get the number of seconds that the store has been active.

{} Это метод класса: WCAdminHelper{}

Хуков нет.

Возвращает

number. Number of seconds.

Использование

$result = WCAdminHelper::get_wcadmin_active_for_in_seconds();

Код WCAdminHelper::get_wcadmin_active_for_in_seconds() WC 6.4.1

public static function get_wcadmin_active_for_in_seconds() {
	$install_timestamp = get_option( self::WC_ADMIN_TIMESTAMP_OPTION );

	if ( ! is_numeric( $install_timestamp ) ) {
		$install_timestamp = time();
		update_option( self::WC_ADMIN_TIMESTAMP_OPTION, $install_timestamp );
	}

	return time() - $install_timestamp;
}