<?php
/**
 * Plugin Name: Blazemedia Drivek Integrator
 * Plugin URI: https://www.blazemedia.it/
 * Description: This is the Blazemedia plugin for Drivek integration.
 * Version: 1.0.0
 * Author: Blazemedia
 * License: http://www.apache.org/licenses/LICENSE-2.0
 * Text Domain: drivek-integrator
 */

defined('ABSPATH') || exit;

require_once __DIR__ . '/vendor/autoload.php';

use Blazemedia\DriveKIntegrator;
use Blazemedia\DriveKIntegrator\AdminUserInterface\Buttons;
use Blazemedia\DriveKIntegrator\Render;

add_action('plugins_loaded', function () {

    
    DriveKIntegrator\Environment::init();
    Render\DriveKwidget::init();

    if(is_admin()) {

        $button = new Buttons\DriveKModelButton;
        
    }

});

// Istanzia il widget dopo che WordPress ha determinato il post corrente
add_action('wp', function () {
    $listinoWidget = new Render\DriveKListinoWidget;
});
