<?php

/**
 * Plugin Name:       Modern Fields
 * Description:       Awesome custom fields for the Block Editor.
 * Version:           1.3.0
 * Requires at least: 6.8
 * Requires PHP:      8.1
 * Author:            Maxime BERNARD-JACQUET
 * License:           GPL-2.0-or-later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain:       modern-fields
 *
 * Copyright © 2024-2026 Dysign. "Modern Fields"™ is a trademark of Dysign.
 * The GPL applies to the code only, not to the name or logo.
 */

# Avoid direct access to the plugin file
defined('ABSPATH') || exit;

# Plugin constants
define('MODERN_FIELDS_VERSION', '1.3.0');
define('MODERN_FIELDS_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('MODERN_FIELDS_PLUGIN_URL', plugin_dir_url(__FILE__));
define('MODERN_FIELDS_PLUGIN_BASENAME', plugin_basename(__FILE__));
define('MODERN_FIELDS_PLUGIN_FILE', __FILE__);
define('MODERN_FIELDS_CPT_SLUG', 'mf_field_group');
define('MODERN_FIELDS_FIELD_CPT_SLUG', 'mf_field');
define('MODERN_FIELDS_CPT_REST_BASE', 'mf-field-groups');
define('MODERN_FIELDS_REST_NAMESPACE', 'modern-fields/v1');
define('MODERN_FIELDS_OPTIONS_PAGE_SLUG', 'mf-options-');
define('MODERN_FIELDS_POST_TYPES_CPT_SLUG', 'mf_post_type');
define('MODERN_FIELDS_TAXONOMIES_CPT_SLUG', 'mf_taxonomy');
define('MODERN_FIELDS_BLOCKS_CPT_SLUG', 'mf_block');

# Load Composer autoloader
require_once MODERN_FIELDS_PLUGIN_DIR . 'vendor/autoload.php';

# Load global functions
require_once MODERN_FIELDS_PLUGIN_DIR . 'global-functions.php';

# Singleton instance
function ModernFields()
{
  return ModernFields\Plugin::getInstance();
}

# Go!
ModernFields();
