<?php
/*
 * Plugin Name: Ticketleo Events
 * Description: Werben Sie Ihre Ticketleo-Events direkt auf Ihrer Website – wählen Sie aus drei flexiblen Ansichten.
 * Version: 1.1
 * Author: Hayloft-IT GmbH
 * Author URI: https://www.hayloft-it.ch/
 * License: GPLv2 or later
 * Text Domain: ticketleo-events
 * Domain Path: /languages
 */
declare(strict_types=1);

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

// Define constants for paths
define('TLEVENTS_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('TLEVENTS_PLUGIN_URL', plugin_dir_url(__FILE__));

// Autoload required class files
require_once TLEVENTS_PLUGIN_DIR . 'classes/class-tlevents-main.php';
require_once TLEVENTS_PLUGIN_DIR . 'classes/class-tlevents-block.php';

if (!function_exists('tlevents_init')) {
    function tlevents_init() : void
    {
        load_plugin_textdomain('ticketleo-events', false, plugin_basename(dirname(__FILE__)) . '/languages');

        $events = new TLEvents_Main();

        new TLEvents_Block('event', $events);
        new TLEvents_Block('eventslist', $events);
    }
}
add_action('init', 'tlevents_init');