<?php

/**
 * The plugin bootstrap file
 *
 * This file is read by WordPress to generate the plugin information in the plugin
 * admin area. This file also includes all of the dependencies used by the plugin,
 * registers the activation and deactivation functions, and defines a function
 * that starts the plugin.
 *
 * @link              https://thedock.io
 * @since             1.0.0
 * @package           Thedock_Enhanced_Rich_Text_Editor
 *
 * @wordpress-plugin
 * Plugin Name:       TheDock Enhanced Rich Text Editor
 * Plugin URI:        https://thedock.io/enhanced-rich-text-editor
 * Description:       Upgrade WordPress to TinyMCE 7 with a modern editing experience, table support, and seamless ACF and JetEngine integration.
 * Version:           1.1.1
 * Author:            TheDock
 * Author URI:        https://thedock.io/
 * License:           GPL-2.0+
 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
 * Text Domain:       thedock-enhanced-rich-text-editor
 * Domain Path:       /languages
 * Requires at least: 6.0
 * Requires PHP:      7.4
 */

// If this file is called directly, abort.
if (! defined('WPINC')) {
    die;
}

/**
 * Plugin version.
 * Uses SemVer - https://semver.org
 */
define('THEDOCK_ENHANCED_RTE_VERSION', '1.1.1');

/**
 * Asset version for cache busting during development.
 * Uses file modification time in debug mode, plugin version in production.
 */
if (defined('WP_DEBUG') && WP_DEBUG) {
    define('THEDOCK_ENHANCED_RTE_ASSET_VERSION', filemtime(__FILE__));
} else {
    define('THEDOCK_ENHANCED_RTE_ASSET_VERSION', THEDOCK_ENHANCED_RTE_VERSION);
}

/**
 * The code that runs during plugin activation.
 * This action is documented in includes/class-thedock-enhanced-rich-text-editor-activator.php
 */
function thedock_enhanced_rte_activate()
{
    require_once plugin_dir_path(__FILE__) . 'includes/class-thedock-enhanced-rich-text-editor-activator.php';
    Thedock_Enhanced_Rich_Text_Editor_Activator::activate();
}

/**
 * The code that runs during plugin deactivation.
 * This action is documented in includes/class-thedock-enhanced-rich-text-editor-deactivator.php
 */
function thedock_enhanced_rte_deactivate()
{
    require_once plugin_dir_path(__FILE__) . 'includes/class-thedock-enhanced-rich-text-editor-deactivator.php';
    Thedock_Enhanced_Rich_Text_Editor_Deactivator::deactivate();
}

register_activation_hook(__FILE__, 'thedock_enhanced_rte_activate');
register_deactivation_hook(__FILE__, 'thedock_enhanced_rte_deactivate');

/**
 * The core plugin class that is used to define internationalization,
 * admin-specific hooks, and public-facing site hooks.
 */
require plugin_dir_path(__FILE__) . 'includes/class-thedock-enhanced-rich-text-editor.php';

/**
 * Begins execution of the plugin.
 *
 * Since everything within the plugin is registered via hooks,
 * then kicking off the plugin from this point in the file does
 * not affect the page life cycle.
 *
 * @since    1.0.0
 */
function thedock_enhanced_rte_run()
{

    $plugin = new Thedock_Enhanced_Rich_Text_Editor();
    $plugin->run();

}
thedock_enhanced_rte_run();
