function rcl_get_list_custom_fields($post_id, $posttype = false, $id_form = false)
{
    $get_fields = rcl_get_custom_fields($post_id, $posttype, $id_form);
    if (!$get_fields) {
        return false;
    }
    $public_fields = '';
    $data = array('ID' => $post_id, 'post_type' => $posttype, 'form_id' => $id_form);
    $cf = new Rcl_Custom_Fields();
    foreach ((array) $get_fields as $key => $custom_field) {
        if ($key === 'options') {
            continue;
        }
        $custom_field = apply_filters('custom_field_public_form', $custom_field, $data);
        $star = $custom_field['requared'] == 1 ? ' <span class="required">*</span> ' : '';
        $postmeta = $post_id ? get_post_meta($post_id, $custom_field['slug'], 1) : '';
        $public_fields .= '<tr><th><label>' . $cf->get_title($custom_field) . $star . ':</label></th>';
        $public_fields .= '<td>' . $cf->get_input($custom_field, $postmeta) . '</td>';
        $public_fields .= '</tr>';
    }
    if (isset($public_fields)) {
        $public_fields = '<table>' . $public_fields . '</table>';
        return $public_fields;
    } else {
        return false;
    }
}
function rcl_publication_termlist($tax = false)
{
    global $group_id, $rcl_options, $options_gr, $formData;
    if ($tax) {
        $formData->taxonomy[$formData->post_type] = $tax;
    }
    if (!isset($formData->taxonomy[$formData->post_type]) && $formData->post_id) {
        return false;
    }
    $ctg = $formData->terms ? $formData->terms : 0;
    if ($formData->post_type == 'post') {
        $cf = rcl_get_custom_fields($formData->post_id, $formData->post_type, $formData->form_id);
        if (!$ctg) {
            $ctg = isset($cf['options']['terms']) && $cf['options']['terms'] ? $cf['options']['terms'] : $rcl_options['id_parent_category'];
        }
        $cnt = isset($rcl_options['count_category_post']) ? $rcl_options['count_category_post'] : 0;
    }
    if ($formData->post_type == 'post-group') {
        $options_gr = rcl_get_options_group($group_id);
        $catlist = rcl_get_tags_list_group($options_gr['tags'], $formData->post_id);
    } else {
        $cnt = !$cnt ? 1 : $cnt;
        $cat_list = $formData->post_id ? get_public_catlist() : '';
        $sel = new Rcl_List_Terms();
        $catlist = $sel->get_select_list(get_public_allterms(), $cat_list, $cnt, $ctg);
    }
    if (!$catlist) {
        return false;
    }
    echo '<label>' . __('Category', 'wp-recall') . ':</label>' . $catlist;
}
function rcl_get_custom_post_meta($post_id)
{
    $get_fields = rcl_get_custom_fields($post_id);
    if ($get_fields) {
        $cf = new Rcl_Custom_Fields();
        foreach ((array) $get_fields as $custom_field) {
            $custom_field = apply_filters('rcl_custom_post_meta', $custom_field);
            if (!$custom_field) {
                continue;
            }
            $p_meta = get_post_meta($post_id, $custom_field['slug'], true);
            $show_custom_field .= $cf->get_field_value($custom_field, $p_meta);
        }
        return $show_custom_field;
    }
}