<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>

<div class="ehx-admin-builder register">

    <div class="clear"></div>

    <div class="ehx-admin-drag">
        <div class="ehx-admin-drag-ajax ui-sortable" data-form_id="130">
            <div class="ehx-admin-drag-row" data-original="_ehx_row_1">
                <span class="ehx-admin-row-loading"><span></span></span>

                <div class="clear"></div>
                <div class="ehx-admin-drag-rowsubs ui-sortable">
                    <div class="ehx-admin-drag-rowsub ui-sortable">

                        <div class="ehx-admin-drag-col ui-sortable cols-1 cols-last">

                            <div class="ehx-admin-columns">
                                <?php
                                    $ehx_custom_fields = get_post_meta($post->ID, '_ehx_custom_field', true);
                                    if (gettype($ehx_custom_fields) == 'array') {
                                        foreach ($ehx_custom_fields as $index => $validated) {
                                            include EHXME_PLUGIN_DIR . 'views/admin/inc/input-field.php';
                                        }
                                    }
                                ?>
                            </div>

                            <a href="#" class="ehx-admin-drag-add-field ehx-tip-n" id="openEhxModal" data-element="#ehx-modal" data-action="ehxme_add_field_modal" data-nonce="<?php echo esc_html(wp_create_nonce('ehxme_add_field_modal')) ?>">
                                <span class="dashicons dashicons-plus"></span>
                            </a>
                        </div>

                        <div class="ehx-admin-drag-col-dynamic"></div>
                        <div class="clear"></div>
                    </div>
                </div>
            </div>
        </div>

    </div>

</div>