18.430000000000003,"battery":null,"uid":42404935},{"ts_unix":1747631201,"time_stamp":"2025-05-19T07:06:41+02:00","humidity":-255,"temperature":null,"battery":null,"uid":42404935},{"ts_unix":1747631201,"time_stamp":"2025-05-19T07:06:41+02:00","humidity":null,"temperature":null,"battery":null,"uid":42404935,"battery_volts":100},{"ts_unix":1747631201,"time_stamp":"2025-05-19T07:06:41+02:00","humidity":null,"temperature":18.430000000000003,"battery":null,"uid":42404935},{"ts_unix":1747631201,"time_stamp":"2025-05-19T07:06:41+02:00","humidity":-255,"temperature":null,"battery":null,"uid":42404935},{"ts_unix":1747631212,"time_stamp":"2025-05-19T07:06:52+02:00","humidity":null,"temperature":null,"battery":null,"uid":42404935,"geoloc_LAT":46.846149,"geoloc_LON":9.533986,"geoloc_ALT":0},{"ts_unix":1747638401,"time_stamp":"2025-05-19T09:06:41+02:00","humidity":null,"temperature":null,"battery":100,"uid":42408793,"firmware_version":"2.7"},{"ts_unix":1747638401,"time_stamp":"2025-05-19T09:06:41+02:00","humidity":null,"temperature":null,"battery":null,"uid":42408793},{"ts_unix":1747638401,"time_stamp":"2025-05-19T09:06:41+02:00","humidity":null,"temperature":null,"battery":null,"uid":42408793,"pressure":954},{"ts_unix":1747638401,"time_stamp":"2025-05-19T09:06:41+02:00","humidity":null,"temperature":17.810000000000002,"battery":null,"uid":42408793},{"ts_unix":1747638401,"time_stamp":"2025-05-19T09:06:41+02:00","humidity":-255,"temperature":null,"battery":null,"uid":42408793},{"ts_unix":1747638401,"time_stamp":"2025-05-19T09:06:41+02:00","humidity":null,"temperature":null,"battery":null,"uid":42408793,"battery_volts":100},{"ts_unix":1747638401,"time_stamp":"2025-05-19T09:06:41+02:00","humidity":null,"temperature":17.810000000000002,"battery":null,"uid":42408793},{"ts_unix":1747638401,"time_stamp":"2025-05-19T09:06:41+02:00","humidity":-255,"temperature":null,"battery":null,"uid":42408793},{"ts_unix":1747638412,"time_stamp":"2025-05-19T09:06:52+02:00","humidity":null,"temperature":null,"battery":null,"uid":42408793,"geoloc_LAT":46.845516,"geoloc_LON":9.507067,"geoloc_ALT":0},{"ts_unix":1747652801,"time_stamp":"2025-05-19T13:06:41+02:00","humidity":null,"temperature":null,"battery":100,"uid":42416202,"firmware_version":"2.7"},{"ts_unix":1747652801,"time_stamp":"2025-05-19T13:06:41+02:00","humidity":null,"temperature":null,"battery":null,"uid":42416202},{"ts_unix":1747652801,"time_stamp":"2025-05-19T13:06:41+02:00","humidity":null,"temperature":null,"battery":null,"uid":42416202,"pressure":952},{"ts_unix":1747652801,"time_stamp":"2025-05-19T13:06:41+02:00","humidity":null,"temperature":18.310000000000002,"battery":null,"uid":42416202},{"ts_unix":1747652801,"time_stamp":"2025-05-19T13:06:41+02:00","humidity":-255,"temperature":null,"battery":null,"uid":42416202},{"ts_unix":1747652801,"time_stamp":"2025-05-19T13:06:41+02:00","humidity":null,"temperature":null,"battery":null,"uid":42416202,"battery_volts":100},{"ts_unix":1747652801,"time_stamp":"2025-05-19T13:06:41+02:00","humidity":null,"temperature":18.310000000000002,"battery":null,"uid":42416202},{"ts_unix":1747652801,"time_stamp":"2025-05-19T13:06:41+02:00","humidity":-255,"temperature":null,"battery":null,"uid":42416202},{"ts_unix":1747652824,"time_stamp":"2025-05-19T13:07:04+02:00","humidity":null,"temperature":null,"battery":null,"uid":42416202,"geoloc_LAT":46.846161,"geoloc_LON":9.534074,"geoloc_ALT":0},{"ts_unix":1747660002,"time_stamp":"2025-05-19T15:06:42+02:00","humidity":null,"temperature":null,"battery":100,"uid":42419984,"firmware_version":"2.7"},{"ts_unix":1747660002,"time_stamp":"2025-05-19T15:06:42+02:00","humidity":null,"temperature":null,"battery":null,"uid":42419984},{"ts_unix":1747660002,"time_stamp":"2025-05-19T15:06:42+02:00","humidity":null,"temperature":null,"battery":null,"uid":42419984,"pressure":952},{"ts_unix":1747660002,"time_stamp":"2025-05-19T15:06:42+02:00","humidity":null,"temperature":18.37,"battery":null,"uid":42419984},{"ts_unix":1747660002,"time_stamp":"2025-05-19T15:06:42+02:00","humidity":-255,"temperature":null,"battery":null,"uid":42419984},{"ts_uic' => __( '900 Italic', 'inspiro' ), ); } return apply_filters( 'inspiro/font-weight', self::$font_weight ); } /** * Get font weight for selected Font Family passed by setting key * * @param string $setting_key The setting key name for Font Family control. * @param WP_Customize_Manager $wp_customize instance of WP_Customize_Manager. * @return array */ public static function get_font_family_weight( $setting_key, $wp_customize ) { $font_family_weight = array( '' => __( 'Inherit', 'inspiro' ), ); if ( ! is_object( $wp_customize->get_setting( $setting_key ) ) ) { return $font_family_weight; } $default = $wp_customize->get_setting( $setting_key )->default; $select_font_family = get_theme_mod( $setting_key, $default ); $font_family = self::clean_google_fonts( $select_font_family ); $all_font_weight = self::get_all_font_weight(); if ( isset( self::$google_fonts[ $font_family ][0] ) && is_array( self::$google_fonts[ $font_family ][0] ) ) { foreach ( self::$google_fonts[ $font_family ][0] as $font_weight ) { // Skip font variants (italic, i). if ( strpos( $font_weight, 'italic' ) === false || strpos( $font_weight, 'i' ) === false ) { $font_family_weight[ $font_weight ] = $all_font_weight[ $font_weight ]; } } } return $font_family_weight; } /** * Get font presets * * @return array Array of all font presets for Inspiro theme */ public static function get_font_presets() { if ( empty( self::$font_presets ) ) { self::$font_presets = array( array( 'name' => 'Default', 'image' => 'system.png', 'mods' => array( 'body-font-family' => '', 'body-font-size' => '16', 'body-font-weight' => '400', 'body-text-transform' => '', 'body-line-height' => '1.8', // TODO: add all settings here. ), ), ); // TODO: add font presets. } return apply_filters( 'inspiro/font-presets', self::$font_presets ); } /** * Clean font name. * * Google Fonts are saved as {'Font Name', Category}. This function cleanes this up to retreive only the {Font Name}. * * @since 1.3.0 * @param string $font_value Name of the font. * * @return string Font name where commas and inverted commas are removed if the font is a Google Font. */ public static function clean_google_fonts( $font_value ) { // Bail if fontVAlue does not contain a comma. if ( strpos( $font_value, ',' ) === false ) { return $font_value; } $split_font = explode( ',', $font_value ); $google_font_value = str_replace( "'", '', $split_font[0] ); // Check if the cleaned font exists in the Google fonts array. $google_fonts = self::get_google_fonts(); if ( isset( $google_fonts[ $google_font_value ] ) ) { $font_value = $google_font_value; } return $font_value; } } }