/** * JetFormBuilder: termin_txt = jedna data albo skrócony zakres: * - 22 stycznia 2026 * - 22–24 stycznia 2026 * - 22 stycznia – 2 lutego 2026 * - 22 grudnia 2026 – 2 stycznia 2027 */ add_action( 'jet-form-builder/form-handler/before-send', function( $handler ) { // Opcjonalnie: ogranicz do konkretnego formularza (ID z JetFormBuilder → Forms) // if ( (int) $handler->get_form_id() !== 123 ) { return; } $to_ts = function( $value ) { $value = is_string( $value ) ? trim( $value ) : $value; if ( $value === '' || $value === null ) { return 0; } // JetEngine Date czasem zwraca timestamp if ( is_numeric( $value ) ) { return (int) $value; } $ts = strtotime( (string) $value ); return $ts ? $ts : 0; }; $start_ts = $to_ts( jet_fb_context()->get_request( 'poczatek_szkolenia' ) ); $end_ts = $to_ts( jet_fb_context()->get_request( 'koniec_szkolenia' ) ); if ( ! $start_ts || ! $end_ts ) { return; } $start_day = wp_date( 'j', $start_ts ); // 22 $start_month = wp_date( 'n', $start_ts ); // 1..12 $start_year = wp_date( 'Y', $start_ts ); // 2026 $end_day = wp_date( 'j', $end_ts ); $end_month = wp_date( 'n', $end_ts ); $end_year = wp_date( 'Y', $end_ts ); // Ten sam dzień (YYYY-mm-dd) if ( wp_date( 'Y-m-d', $start_ts ) === wp_date( 'Y-m-d', $end_ts ) ) { $term = wp_date( 'j F Y', $start_ts ); } elseif ( $start_year === $end_year && $start_month === $end_month ) { // Ten sam miesiąc i rok: 22–24 stycznia 2026 $term = $start_day . '–' . $end_day . ' ' . wp_date( 'F Y', $start_ts ); } elseif ( $start_year === $end_year ) { // Ten sam rok, różne miesiące: 22 stycznia – 2 lutego 2026 $term = wp_date( 'j F', $start_ts ) . ' – ' . wp_date( 'j F Y', $end_ts ); } else { // Różne lata: 22 grudnia 2026 – 2 stycznia 2027 $term = wp_date( 'j F Y', $start_ts ) . ' – ' . wp_date( 'j F Y', $end_ts ); } jet_fb_context()->update_request( $term, 'termin_txt' ); }, 10, 1 );

Ups...

Strona, której szukasz zaginęła niczym 70 milionów, które...
A zresztą, sam wiesz co ;)

/** * Human-friendly Online Status + Last Activity */ define('EA_ONLINE_THRESHOLD', 5 * 60); // online if active within 5 min define('EA_ACTIVITY_THROTTLE', 60); // update max once per 60 sec // 1️⃣ Aktualizacja aktywności (lekka) add_action('init', function () { if (!is_user_logged_in()) return; $user_id = get_current_user_id(); if (!$user_id) return; $t_key = 'ea_last_activity_throttle_' . $user_id; if (get_transient($t_key)) return; update_user_meta($user_id, 'ea_last_activity', time()); set_transient($t_key, 1, EA_ACTIVITY_THROTTLE); }); // 2️⃣ Logika tylko dla users.php add_action('load-users.php', function () { add_filter('manage_users_columns', function ($columns) { $columns['ea_online'] = 'Aktywność'; return $columns; }); add_filter('manage_users_custom_column', function ($output, $column_name, $user_id) { if ($column_name !== 'ea_online') return $output; $last = (int) get_user_meta($user_id, 'ea_last_activity', true); if (!$last) { return '
Brak danych'; } $delta = time() - $last; $is_online = ($delta < EA_ONLINE_THRESHOLD); $class = $is_online ? 'ea-online' : 'ea-offline'; // 🧠 "po ludzku" if ($is_online) { $label = 'Online teraz'; } else { $today = current_time('timestamp'); $yesterday = strtotime('-1 day', $today); if (date('Y-m-d', $last) === date('Y-m-d', $today)) { $label = 'Dziś, ' . date_i18n(get_option('time_format'), $last); } elseif (date('Y-m-d', $last) === date('Y-m-d', $yesterday)) { $label = 'Wczoraj, ' . date_i18n(get_option('time_format'), $last); } else { $label = date_i18n( get_option('date_format') . ', ' . get_option('time_format'), $last ); } } return '
' . esc_html($label) . ' '; }, 10, 3); add_action('admin_head', function () { echo ''; }); });