<?php

 if( !defined( 'ABSPATH' ) ) {
    die('You cannot be here');
 }

add_action('wp_enqueue_scripts', 'eprc_enqueue_custom_scripts');
add_shortcode('easy_pricing', 'eprc_show_easy_pricing');
add_action('add_meta_boxes', 'eprc_create_meta_box');

function eprc_enqueue_custom_scripts(){
    wp_enqueue_script(
        'custom-script',
        EPRC_MY_PLUGIN_URL . '/includes/templates/handleOnClick.js',
        array('jquery'),
        null,
        true
    );

    $pricing_plans = eprc_get_plugin_options('pricing_plans');
    wp_localize_script(
        'custom-script',
        'pricingData',
        array('pricing_plans' => $pricing_plans)
    );

     wp_enqueue_style('contact-form-plugin', EPRC_MY_PLUGIN_URL . '/assets/css/easy-pricing.css' );
     wp_enqueue_style( 'poppins-font', 'https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap' );

}

function eprc_create_meta_box() {
    add_meta_box('custom_contact_form', 'submission', 'display_submission', 'submission');
}

function eprc_show_easy_pricing() {
    ob_start();  // Start output buffering
    include EPRC_MY_PLUGIN_PATH . 'includes/templates/easy-pricing.php';
    return ob_get_clean();  // End output buffering and return the output as a string
}
