esc_url_raw( rest_url( 'rooster-lms/v1/' ) ), 'nonce' => $user > 0 ? wp_create_nonce( 'wp_rest' ) : '', 'lang' => Switcher::current(), ), $extra ); } public static function when( ?string $utc ): string { if ( null === $utc || '' === $utc ) { return ''; } $ts = strtotime( $utc . ' UTC' ); return false === $ts ? '' : wp_date( get_option( 'date_format' ) . ' ' . get_option( 'time_format' ), $ts ); } }