<?php

/**
 * The public-facing functionality of the plugin.
 *
 * @link       https://chrisjayden.com
 * @since      1.0.0
 *
 * @package    Yummy_Cookies
 * @subpackage Yummy_Cookies/public
 */

/**
 * The public-facing functionality of the plugin.
 *
 * Defines the plugin name, version, and two examples hooks for how to
 * enqueue the public-facing stylesheet and JavaScript.
 *
 * @package    Yummy_Cookies
 * @subpackage Yummy_Cookies/public
 * @author     Chris Jayden <chris@chrisjayden.com>
 */
class Yummy_Cookies_Public {

	/**
	 * The ID of this plugin.
	 *
	 * @since    1.0.0
	 * @access   private
	 * @var      string    $plugin_name    The ID of this plugin.
	 */
	private $plugin_name;

	/**
	 * The version of this plugin.
	 *
	 * @since    1.0.0
	 * @access   private
	 * @var      string    $version    The current version of this plugin.
	 */
	private $version;

	/**
	 * Initialize the class and set its properties.
	 *
	 * @since    1.0.0
	 * @param      string $plugin_name       The name of the plugin.
	 * @param      string $version    The version of this plugin.
	 */
	public function __construct( $plugin_name, $version ) {
		$this->plugin_name = $plugin_name;
		$this->version     = $version;
		add_action( 'elementor/dynamic_tags/register_tags', [ $this, 'elementor_integration' ] );
	}

	/**
	 * Register the Elementor integration.
	 *
	 * @param object $dynamic_tags
	 * @author Chris Jayden <chris@chrisjayden.com>
	 */
	public function elementor_integration( $dynamic_tags ) {
		\Elementor\Plugin::$instance->dynamic_tags->register_group( 'yummy-cookies', [ 'title' => 'Yummy Cookies 🍪' ] );

		include_once 'class-yummy-cookies-elementor-cookie-value.php';
		$dynamic_tags->register_tag( 'Yummy_Cookies_Elementor_Cookie_Value' );

		include_once 'class-yummy-cookies-elementor-cookie-name.php';
		$dynamic_tags->register_tag( 'Yummy_Cookies_Elementor_Cookie_Name' );
	}

}
