<?php
//use Carbon_Fields\Container;
//use Carbon_Fields\Field;

add_action( 'carbon_fields_register_fields', 'TkNa_free_cartas');

function TkNa_free_cartas() {

    $urlPost = isset($_GET['post']) ? sanitize_text_field($_GET['post']) : '';
    $CustomType = isset($_GET['post_type']) ? sanitize_text_field($_GET['post_type']) : '';
    $thumbID = get_post_thumbnail_id( $urlPost) !== null ? get_post_thumbnail_id( $urlPost ) : '';
    $imgPost = wp_get_attachment_url( $thumbID )!== null ? wp_get_attachment_url( $thumbID ) : '';

    $tarot =  get_option('tarokina_tarokina_free');
    $tarot = ($tarot) ? $tarot['tarokina_tarokina_free'][0] : array() ;


        if ($tarot) {

            $title = get_the_title( $urlPost );
            $tirada = $tarot['tkta_free_name'];
            $deks = $tarot['tkta_free_barajas'];
            $modes = $tarot['tkta_free_mode'];
            $spread = $tarot['tkta_free_spread'];

            $i = substr($spread,-1);
            $id_unique = trim($tarot['tkta_free_id']);
            $spre = 3;
            $mode_name = __( 'Basic', 'tarokina-free' );

            include TAROKINA_ADMIN_PATH_FREE. '3cards-basic-subfields.php';

        }

};
