当前位置: 首页>>代码示例>>PHP>>正文


PHP FrmFieldsHelper::dropdown_categories方法代码示例

本文整理汇总了PHP中FrmFieldsHelper::dropdown_categories方法的典型用法代码示例。如果您正苦于以下问题:PHP FrmFieldsHelper::dropdown_categories方法的具体用法?PHP FrmFieldsHelper::dropdown_categories怎么用?PHP FrmFieldsHelper::dropdown_categories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FrmFieldsHelper的用法示例。


在下文中一共展示了FrmFieldsHelper::dropdown_categories方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

        foreach ($new_entries as $ent) {
            $new_field->options[$ent->item_id] = $ent->meta_value;
        }
    }
} else {
    if (isset($new_field->field_options['post_field']) and $new_field->field_options['post_field'] == 'post_status') {
        $new_field->options = FrmProFieldsHelper::get_status_options($new_field);
    } else {
        $new_field->options = stripslashes_deep(maybe_unserialize($new_field->options));
    }
}
if (isset($new_field->field_options['post_field']) and $new_field->field_options['post_field'] == 'post_category') {
    $new_field = (array) $new_field;
    $new_field['value'] = (isset($field) and isset($field['hide_opt'][$meta_name])) ? $field['hide_opt'][$meta_name] : '';
    $new_field['exclude_cat'] = isset($new_field->field_options['exclude_cat']) ? $new_field->field_options['exclude_cat'] : '';
    echo FrmFieldsHelper::dropdown_categories(array('name' => "field_options[hide_opt_{$current_field_id}][]", 'id' => "field_options[hide_opt_{$current_field_id}]", 'field' => $new_field));
} else {
    $temp_field = (array) $new_field;
    foreach ($new_field->field_options as $fkey => $fval) {
        $temp_field[$fkey] = $fval;
        unset($fkey);
        unset($fval);
    }
    ?>
<select name="field_options[hide_opt_<?php 
    echo $current_field_id;
    ?>
][]">
    <option value=""><?php 
    echo $new_field->type == 'data' ? 'Anything' : 'Select';
    ?>
开发者ID:edelkevis,项目名称:git-plus-wordpress,代码行数:31,代码来源:field-values.php

示例2: esc_attr

                echo esc_attr($field['id']);
                ?>
_opts" class="frm_sortable_field_opts frm_clear<?php 
                echo count($field['options']) > 10 ? ' frm_field_opts_list' : '';
                ?>
">
        <?php 
                include FrmAppHelper::plugin_path() . '/classes/views/frm-fields/radio.php';
                ?>
        </ul>
    <?php 
            }
        } else {
            if ($field['type'] == 'select') {
                if (isset($field['post_field']) && $field['post_field'] == 'post_category') {
                    echo FrmFieldsHelper::dropdown_categories(array('name' => $field_name, 'field' => $field));
                } else {
                    ?>
	<select name="<?php 
                    echo esc_attr($field_name) . (FrmField::is_option_true($field, 'multiple') ? '[]' : '');
                    ?>
" <?php 
                    echo FrmField::is_option_true($field, 'size') ? 'class="auto_width"' : '';
                    echo FrmField::is_option_true($field, 'multiple') ? ' multiple="multiple"' : '';
                    ?>
 >
		<?php 
                    foreach ($field['options'] as $opt_key => $opt) {
                        $field_val = apply_filters('frm_field_value_saved', $opt, $opt_key, $field);
                        $opt = apply_filters('frm_field_label_seen', $opt, $opt_key, $field);
                        $selected = $field['default_value'] == $field_val || FrmFieldsHelper::get_other_val(array('opt_key', 'field')) ? ' selected="selected"' : '';
开发者ID:mazykin46,项目名称:portfolio,代码行数:31,代码来源:show-build.php

示例3: isset

            $new_field->options[$ent->item_id] = $ent->meta_value;
        }
    }
} else {
    if (isset($new_field->field_options['post_field']) && $new_field->field_options['post_field'] == 'post_status') {
        $new_field->options = FrmProFieldsHelper::get_status_options($new_field);
    }
}
if (isset($new_field->field_options['post_field']) && $new_field->field_options['post_field'] == 'post_category') {
    if (!isset($field_name)) {
        $field_name = 'field_options[hide_opt_' . $current_field_id . ']';
    }
    $new_field = (array) $new_field;
    $new_field['value'] = isset($field) && isset($field['hide_opt'][$meta_name]) ? $field['hide_opt'][$meta_name] : '';
    $new_field['exclude_cat'] = isset($new_field->field_options['exclude_cat']) ? $new_field->field_options['exclude_cat'] : '';
    echo FrmFieldsHelper::dropdown_categories(array('name' => "{$field_name}[]", 'id' => $field_name, 'field' => $new_field, 'show_option_all' => $new_field['type'] == 'data' && (!isset($field_type) || isset($field_type) && $field_type == 'data') ? $anything : ' '));
} else {
    if (!isset($field_name)) {
        $field_name = 'field_options[hide_opt_' . $current_field_id . '][]';
    }
    $temp_field = (array) $new_field;
    foreach ($new_field->field_options as $fkey => $fval) {
        $temp_field[$fkey] = $fval;
        unset($fkey);
        unset($fval);
    }
    if (!isset($val)) {
        $val = isset($field) && isset($field['hide_opt'][$meta_name]) ? $field['hide_opt'][$meta_name] : '';
    }
    if (in_array($new_field->type, array('select', 'radio', 'checkbox', 'scale', 'data'))) {
        ?>
开发者ID:amit0773,项目名称:manaslake,代码行数:31,代码来源:field-values.php


注:本文中的FrmFieldsHelper::dropdown_categories方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。