function get_taxonomy_count($taxonomy, $post_categories, $tax_count = 0)
 {
     if (isset($post_categories[$taxonomy . $tax_count])) {
         $tax_count++;
         $tax_count = FrmProFormsHelper::get_taxonomy_count($taxonomy, $post_categories, $tax_count);
     }
     return $tax_count;
 }
Esempio n. 2
0
<?php 
    unset($post_type);
}
unset($post_types);
?>
            </select>
        </td>
    </tr>
        <?php 
if (empty($form_action->post_content['post_category']) && !empty($values['fields'])) {
    foreach ($values['fields'] as $fo_key => $fo) {
        if ($fo['post_field'] == 'post_category') {
            if (!isset($fo['taxonomy']) || $fo['taxonomy'] == '') {
                $fo['taxonomy'] = 'post_category';
            }
            $tax_count = FrmProFormsHelper::get_taxonomy_count($fo['taxonomy'], $form_action->post_content['post_category']);
            $form_action->post_content['post_category'][$fo['taxonomy'] . $tax_count] = array('field_id' => $fo['id'], 'exclude_cat' => $fo['exclude_cat'], 'meta_name' => $fo['taxonomy']);
            unset($tax_count);
        } else {
            if ($fo['post_field'] == 'post_custom' && !in_array($fo['custom_field'], $custom_fields)) {
                $form_action->post_content['post_custom_fields'][$fo['custom_field']] = array('field_id' => $fo['id'], 'meta_name' => $fo['custom_field']);
            }
        }
        unset($fo_key, $fo);
    }
}
?>
        <tr>
            <th>
                <label><?php 
_e('Post Title', 'formidable');
<?php 
    unset($post_type);
}
unset($post_types);
?>
            </select>
        </td></tr>
        <?php 
$values['post_category'] = $values['post_custom_fields'] = array();
if (empty($values['post_category']) and !empty($values['fields'])) {
    foreach ($values['fields'] as $fo_key => $fo) {
        if ($fo['post_field'] == 'post_category') {
            if (!isset($fo['taxonomy']) or $fo['taxonomy'] == '') {
                $fo['taxonomy'] = 'post_category';
            }
            $tax_count = FrmProFormsHelper::get_taxonomy_count($fo['taxonomy'], $values['post_category']);
            $values['post_category'][$fo['taxonomy'] . $tax_count] = array('field_id' => $fo['id'], 'exclude_cat' => $fo['exclude_cat'], 'meta_name' => $fo['taxonomy']);
            unset($tax_count);
        } else {
            if ($fo['post_field'] == 'post_custom' and !array_key_exists($fo['custom_field'], $values['post_custom_fields'])) {
                $values['post_custom_fields'][$fo['custom_field']] = array('field_id' => $fo['id'], 'meta_name' => $fo['custom_field']);
            }
        }
    }
}
?>
 
        <tr class="frm_hide_post" <?php 
echo $hide_post;
?>
>