HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux mail.btech-izolacje.pl 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
User: pewna6876 (1017)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: /home/pewnabryka.pl/public_html/wp-content/themes/vehica/functions.php
<?php
update_option('vehica_purchase_code', 'GFJWU8UW-HSLT-E55J-Q9VJ-B556B3TCURUQ');
update_option('vehica_invalid_purchase_code', '0');
update_option('vehica_updater_notice', 1);
define('VEHICA_VERSION', '1.0.101');

add_action('after_setup_theme', static function () {
    add_theme_support('post-thumbnails');
    add_theme_support('nav-menus');
    add_theme_support('title-tag');
    add_theme_support('woocommerce');
    add_theme_support('custom-logo', [
        'width' => 160,
        'height' => 36,
    ]);
    add_theme_support(
        'html5', [
            'search-form',
            'comment-form',
            'comment-list',
            'gallery',
            'caption',
        ]
    );

    load_theme_textdomain('vehica', get_template_directory() . '/languages');

    register_nav_menus(['vehica-primary' => esc_html__('Vehica Theme Default Menu', 'vehica')]);
});

add_action('wp_enqueue_scripts', static function () {
    $deps = [];

    if (!class_exists(\Vehica\Core\App::class)) {
        foreach (['Muli'] as $font) {
            $fontName = strtolower($font);
            $font = str_replace(' ', '+', $font)
                . ':300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic';
            $fontUrl = 'https://fonts.googleapis.com/css?family=' . $font . '&display=swap';

            $subsets = [
                'ru_RU' => 'cyrillic',
                'bg_BG' => 'cyrillic',
                'he_IL' => 'hebrew',
                'el' => 'greek',
                'vi' => 'vietnamese',
                'uk' => 'cyrillic',
                'cs_CZ' => 'latin-ext',
                'ro_RO' => 'latin-ext',
                'pl_PL' => 'latin-ext',
            ];
            $locale = get_locale();

            if (isset($subsets[$locale])) {
                $fontUrl .= '&subset=' . $subsets[$locale];
            }

            wp_enqueue_style('google-font-' . $fontName, $fontUrl, [], false);
        }

        wp_enqueue_style('vehica-blog', get_template_directory_uri() . '/assets/css/style-static.css', ['vehica']);
        wp_enqueue_style('font-awesome', get_template_directory_uri() . '/assets/css/fontawesome.min.css');
        wp_enqueue_script('vehica-blog', get_template_directory_uri() . '/assets/js/main.min.js', ['jquery'], false,
            true);

        if (is_singular(['page', 'post']) && comments_open()) {
            wp_enqueue_script('comment-reply');
        }
    }

    if (class_exists(\Elementor\Plugin::class)) {
        $deps[] = 'elementor-frontend';
    }

    wp_enqueue_style('vehica', get_stylesheet_uri(), $deps, VEHICA_VERSION);
});

require get_template_directory() . '/tgm/class-tgm-plugin-activation.php';
require 'includes/extras.php';

add_action('tgmpa_register', static function () {
    tgmpa(
        [
            [
                'name' => esc_html__('Contact Form 7', 'vehica'),
                'slug' => 'contact-form-7',
                'required' => true,
            ],
            [
                'name' => esc_html__('Elementor', 'vehica'),
                'slug' => 'elementor',
                'required' => true,
                'version' => '3.0.0',
                'force_activation' => false,
                'force_deactivation' => false,
            ],
            [
                'name' => esc_html__('Vehica Core', 'vehica'),
                'slug' => 'vehica-core',
                'source' => get_template_directory() . '/tgm/plugins/vehica-core.zip',
                'required' => true,
                'version' => '1.0.101',
                'force_activation' => false,
                'force_deactivation' => false,
            ],
            [
                'name' => esc_html__('Vehica Updater', 'vehica'),
                'slug' => 'vehica-updater',
                'source' => get_template_directory() . '/tgm/plugins/vehica-updater.zip',
                'required' => false,
                'version' => '1.0.6',
                'force_activation' => false,
                'force_deactivation' => false,
            ],
            [
                'name' => esc_html__('MC4WP', 'vehica'),
                'slug' => 'mailchimp-for-wp',
                'required' => false,
                'version' => '4.8.1',
                'force_activation' => false,
                'force_deactivation' => false,
            ],
        ]
    );
});

add_action('widgets_init', static function () {
    register_sidebar(
        [
            'name' => esc_html__('Vehica Sidebar', 'vehica'),
            'id' => 'vehica-sidebar',
            'description' => esc_html__('Add widgets here.', 'vehica'),
            'before_widget' => '<section id="%1$s" class="widget %2$s">',
            'after_widget' => '</section>',
            'before_title' => '<div class="vehica-widget-title"><h3 class="vehica-widget-title__text">',
            'after_title' => '</h3></div>',
        ]
    );
});

if (!class_exists(Vehica\Core\App::class)) {
    add_theme_support('automatic-feed-links');
}

require get_template_directory() . '/includes/basic.php';

if (!isset($content_width)) {
    $content_width = 600;
}