Automattic\WooCommerce\Admin
WCAdminHelper::get_wcadmin_active_for_in_seconds
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() WCAdminHelper::get wcadmin active for in seconds WC 10.6.2
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;
}