本文整理汇总了PHP中PodsForm::field方法的典型用法代码示例。如果您正苦于以下问题:PHP PodsForm::field方法的具体用法?PHP PodsForm::field怎么用?PHP PodsForm::field使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PodsForm
的用法示例。
在下文中一共展示了PodsForm::field方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wizard_form
function wizard_form($data = null, $name = null, $data_name, $data_text, $checked = true)
{
if (!empty($data)) {
?>
<div class="stuffbox pods-package-import-group">
<h3><label for="link_name"><?php
_e($data_text, 'pods');
?>
</label></h3>
<div class="inside pods-manage-field pods-dependency">
<div class="pods-field-option-group">
<p>
<a href="#toggle" class="button pods-wizard-toggle-all"
data-toggle="<?php
echo $data_name;
?>
"><?php
_e('Toggle all on / off', 'pods');
?>
</a>
</p>
<div class="pods-pick-values pods-pick-checkbox pods-zebra">
<ul>
<?php
$zebra = false;
foreach ($data as $item) {
$class = $zebra ? 'even' : 'odd';
$zebra = !$zebra;
?>
<li class="pods-zebra-<?php
echo $class;
?>
">
<?php
echo PodsForm::field($data_name . '[' . $item[$name] . ']', $checked, 'boolean', array('boolean_yes_label' => $item['name'] . (!empty($item['label']) ? ' (' . $item['label'] . ')' : '')));
?>
</li>
<?php
}
?>
</ul>
</div>
</div>
</div>
</div>
<?php
}
}
示例2: pods_var_raw
if (!isset($pods_tab_form)) {
$row_name = 'field_data[' . $pods_i . '][' . $field_group_name . ']';
}
$value = $field_group_option['default'];
if (isset($field_group_option['value']) && 0 < strlen($field_group_option['value'])) {
$value = $field_group_option['value'];
} else {
$value = pods_var_raw($field_group_name, $field, $value);
}
?>
<li class="<?php
echo esc_attr($depends_option);
?>
">
<?php
echo PodsForm::field($row_name, $value, $field_group_option['type'], $field_group_option);
?>
</li>
<?php
}
?>
</ul>
</div>
</div>
<?php
}
if (false !== $depends_on || !empty($depends)) {
$depends_on = $depends;
}
}
if (!empty($depends_on)) {
示例3: foreach
<div class="pods-pick-values pods-pick-checkbox pods-zebra">
<ul>
<?php
$zebra = false;
foreach ($data as $item) {
$checked = true;
$class = $zebra ? 'even' : 'odd';
$zebra = !$zebra;
?>
<li class="pods-zebra-<?php
echo $class;
?>
">
<?php
echo PodsForm::field($data_name . '[' . $item['id'] . ']', $checked, 'boolean', array('boolean_yes_label' => $item['name'] . (!empty($item['label']) ? ' (' . $item['label'] . ')' : '')));
?>
</li>
<?php
}
?>
</ul>
</div>
</div>
</div>
</div>
<?php
}
do_action('pods_packages_export_options', $pods, $pod_templates, $pod_pages, $pod_helpers);
?>
</div>
示例4: foreach
<?php
foreach ($field_option['group'] as $field_group_name => $field_group_option) {
$field_group_option = PodsForm::field_setup($field_group_option, null, $field_group_option['type']);
if ('boolean' != $field_group_option['type']) {
continue;
}
$field_group_option['boolean_yes_label'] = $field_group_option['label'];
$depends_option = PodsForm::dependencies($field_group_option);
$value = pods_var_raw($field_group_name, $settings, $field_group_option['default']);
?>
<li class="<?php
echo $depends_option;
?>
">
<?php
echo PodsForm::field('pods_setting_' . $field_group_name, $value, $field_group_option['type'], $field_group_option);
?>
</li>
<?php
}
?>
</ul>
</td>
</tr>
<?php
}
if (false !== $depends_on || !empty($depends)) {
$depends_on = $depends;
}
}
if (!empty($depends_on)) {
示例5: foreach
</p>
<div class="pods-pick-values pods-pick-checkbox pods-zebra">
<ul>
<?php
$zebra = false;
foreach ($this->exportable_pods() as $this_pod) {
$class = $zebra ? 'even' : 'odd';
$zebra = !$zebra;
?>
<li class="pods-zebra-<?php
echo $class;
?>
">
<?php
echo PodsForm::field($this_pod['name'], true, 'boolean', array('boolean_yes_label' => $this_pod['name'] . (!empty($this_pod['label']) ? ' (' . $this_pod['label'] . ')' : '')));
?>
</li>
<?php
}
?>
</ul>
</div>
<div class="submit">
<a class="button button-primary" id="export" href="#"> Export </a>
</div>
<textarea id="feedback"></textarea>
</div>
</div>
</div>
</form>
示例6: esc_attr
echo esc_attr($action);
?>
">
<input type="hidden" name="type" value="<?php
echo esc_attr($pod->pod);
?>
" />
<?php
foreach ($fields as $name => $field) {
if ('pick' == $field['type'] && 'pick-custom' != $field['pick_object'] && !empty($field['pick_object'])) {
$field['options']['pick_format_type'] = 'single';
$field['options']['pick_format_single'] = 'dropdown';
$field['options']['pick_select_text'] = '-- ' . $field['label'] . ' --';
$filter = pods_var_raw('filter_' . $name, 'get', '');
echo PodsForm::field('filter_' . $name, $filter, 'pick', $field, $pod->pod, $pod->id());
}
}
?>
<input type="text" class="pods-form-filters-search" name="<?php
echo esc_attr($pod->search_var);
?>
" value="<?php
echo esc_attr($search);
?>
" />
<input type="submit" class="pods-form-filters-submit" value="<?php
echo esc_attr($label);
?>
示例7: _e
<?php
if (!pods_tableless() && apply_filters('pods_admin_setup_add_extend_storage', false)) {
?>
<div class="pods-depends-on pods-depends-on-extend-pod-type pods-depends-on-extend-pod-type-post-type pods-depends-on-extend-pod-type-media pods-depends-on-extend-pod-type-user pods-depends-on-extend-pod-type-comment">
<p><a href="#pods-advanced" class="pods-advanced-toggle"><?php
_e('Advanced', 'pods');
?>
+</a></p>
<div class="pods-advanced">
<div class="pods-field-option">
<?php
echo PodsForm::label('extend_storage', __('Storage Type', 'pods'), array(__('<h6>Storage Types</h6> Table based storage will operate in a way where each field you create for your content type becomes a field in a table. Meta based storage relies upon the WordPress meta storage table for all field data.', 'pods'), 'http://pods.io/docs/comparisons/compare-storage-types/'));
$data = array('meta' => __('Meta Based (WP Default)', 'pods'), 'table' => __('Table Based', 'pods'));
echo PodsForm::field('extend_storage', pods_var_raw('extend_storage', 'post'), 'pick', array('data' => $data));
?>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<div id="pods-wizard-actions">
<div id="pods-wizard-toolbar">
<a href="#start" id="pods-wizard-start" class="button button-secondary"><?php
示例8: foreach
foreach ($fields as $field) {
if ('hidden' == $field['type']) {
continue;
}
?>
<tr class="form-field pods-field <?php
echo 'pods-form-ui-row-type-' . $field['type'] . ' pods-form-ui-row-name-' . PodsForm::clean($field['name'], true);
?>
">
<th scope="row" valign="top"><?php
echo PodsForm::label('pods_field_' . $field['name'], $field['label'], $field['help'], $field);
?>
</th>
<td>
<?php
echo PodsForm::field('pods_field_' . $field['name'], $pod->field(array('name' => $field['name'], 'in_form' => true)), $field['type'], $field, $pod, $pod->id());
?>
<?php
echo PodsForm::comment('pods_field_' . $field['name'], $field['description'], $field);
?>
</td>
</tr>
<?php
}
?>
</table>
</div>
<!-- /.inside -->
</div>
<!-- /#pods-meta-box -->
</div>
示例9: pods_var_raw
?>
</p>
<div class="pods-pick-values pods-pick-checkbox">
<ul>
<li>
<?php
echo PodsForm::field('field_data[' . $pods_i . '][required]', pods_var_raw('required', $field, 0), 'boolean', array('class' => 'pods-dependent-toggle', 'boolean_yes_label' => __('Required', 'pods'), 'help' => __('help', 'pods')));
?>
</li>
<?php
if ('table' == $pod['storage']) {
?>
<li class="pods-excludes-on pods-excludes-on-field-data-type pods-excludes-on-field-data-type-pick pods-excludes-on-field-data-type-file pods-excludes-on-field-data-type-boolean pods-excludes-on-field-data-type-date pods-excludes-on-field-data-type-datetime pods-excludes-on-field-data-type-time">
<?php
echo PodsForm::field('field_data[' . $pods_i . '][unique]', pods_var_raw('unique', $field, 0), 'boolean', array('class' => 'pods-dependent-toggle', 'boolean_yes_label' => __('Unique', 'pods'), 'help' => __('help', 'pods')));
?>
</li>
<?php
}
?>
</ul>
</div>
</div>
</div>
<?php
foreach ($field_tabs as $tab => $tab_label) {
$tab = sanitize_title($tab);
if ('basic' == $tab || !isset($field_tab_options[$tab]) || empty($field_tab_options[$tab])) {
continue;
示例10: __
<p class="pods-field-option-group-label">
<?php
echo PodsForm::label('custom_capabilities[0]', __('Custom Capabilities', 'pods'), __('These capabilities will automatically be created and assigned to this role', 'pods'));
?>
</p>
<div class="pods-pick-values pods-pick-checkbox">
<ul id="custom-capabilities">
<li class="pods-repeater hidden">
<?php
echo PodsForm::field('custom_capabilities[--1]', '', 'text');
?>
</li>
<li>
<?php
echo PodsForm::field('custom_capabilities[0]', '', 'text');
?>
</li>
</ul>
<p>
<a href="#add-capability" id="add-capability" class="button">Add Another Custom Capability</a>
</p>
</div>
</div>
</div>
</div>
</div>
<div id="pods-wizard-actions">
<div id="pods-wizard-toolbar">
示例11: _e
<p class="pods-field-option-group-label">
<?php
_e('Available Taxonomies', 'pods');
?>
</p>
<div class="pods-pick-values pods-pick-checkbox">
<ul>
<?php
foreach ($taxonomies as $taxonomy) {
$taxonomy_name = pods_var_raw('name', $taxonomy);
$taxonomy_label = pods_var_raw('label', $taxonomy, ucwords(str_replace('_', ' ', $taxonomy_name)));
?>
<li>
<?php
echo PodsForm::field('taxonomy[' . $taxonomy_name . ']', pods_var_raw('taxonomy[' . $taxonomy_name . ']', 'post', true), 'boolean', array('boolean_yes_label' => $taxonomy_label . ' (' . $taxonomy_name . ')'));
?>
</li>
<?php
}
?>
</ul>
</div>
</div>
<?php
} else {
?>
<p class="padded"><?php
_e('No Taxonomies were found.', 'pods');
?>
</p>
示例12: input
/**
* Return a field input for a specific field
*
* @param array|string $field Input field name to use (overrides default name)
* @param null $input_name
* @param mixed $value Current value to use
* @param array $options
* @param null $pod
* @param null $id
*
* @return string Field Input HTML
*
* @since 2.3.10
*/
public function input($field, $input_name = null, $value = null, $options = array(), $pod = null, $id = null)
{
// Field data override
if (is_array($field)) {
$field_data = $field;
$field = pods_var_raw('name', $field);
} else {
$field_data = $this->fields($field);
}
if (!empty($field_data)) {
$field_type = $field_data['type'];
if (empty($input_name)) {
$input_name = $field;
}
return PodsForm::field($input_name, $value, $field_type, $field_data, $pod, $id);
}
return '';
}
示例13: _e
<div id="pods-meta-box" class="postbox pods-deploy-ui">
<form action="?page=pods-deploy" method="post">
<div id="icon-tools" class="icon32"><br></div>
<h2>
<?php
_e(sprintf('Pods Deploy: %1s', $key_gen_header), 'pods-deploy');
?>
</h2>
<input type="hidden" class="" name="allow-deploy" id="allow-deploy" value="<?php
echo !$deploy_active;
?>
">
<?php
echo PodsForm::field('_wpnonce', wp_create_nonce('pods-deploy'), 'hidden');
?>
<p class="submit">
<input type="submit" class="button button-primary" name="pods-deploy-key-gen-submit" value="<?php
echo $key_gen_submit;
?>
">
</p>
</form>
<?php
if ($deploy_active) {
?>
<div id="current-keys">
<p>
示例14: manage_wp_posts_be_qe_bulk_quick_edit_custom_box
function manage_wp_posts_be_qe_bulk_quick_edit_custom_box($column_name, $post_type)
{
$post_id = get_the_ID();
switch ($post_type) {
case 'mg_task':
switch ($column_name) {
case 'issue_type':
$issue_type = get_post_meta($post_id, 'issue_type', true);
$pod = pods('mg_task');
$field = $pod->fields['issue_type'];
$pod_field = PodsForm::field("issue_type", $issue_type, 'pick', $field, $pod, $pod->id());
?>
<fieldset class="inline-edit-col-left">
<div class="inline-edit-col">
<label>
<span class="title">Issue Type</span>
<span class="input-text-wrap">
<?php
echo $pod_field;
?>
</span>
</label>
<?php
break;
case 'priority':
$priority = get_post_meta($post_id, 'priority', true);
$pod = pods('mg_task');
$field = $pod->fields['priority'];
$pod_field = PodsForm::field("priority", $priority, 'pick', $field, $pod, $pod->id());
?>
<label>
<span class="title">Priority</span>
<span class="input-text-wrap">
<?php
echo $pod_field;
?>
</span>
</label>
<?php
break;
case 'estimated_time':
$estimated_time = get_post_meta($post_id, 'estimated_time', true);
$pod = pods('mg_task');
$field = $pod->fields['estimated_time'];
$pod_field = PodsForm::field("estimated_time", $estimated_time, 'text', $field, $pod, $pod->id());
?>
<label>
<span class="title">Estimated Time</span>
<span class="input-text-wrap">
<?php
echo $pod_field;
?>
</span>
</label>
<?php
break;
case 'project':
$project = get_post_meta($post_id, 'project', true);
$pod = pods('mg_task');
$field = $pod->fields['project'];
$field['options']['pick_format_style'] = 'dropdown';
$field['options']['pick_format_single'] = 'dropdown';
$pod_field = PodsForm::field("project", $project, 'pick', $field, $pod, $pod->id());
?>
<label>
<span class="title">Project</span>
<span class="input-text-wrap">
<?php
echo $pod_field;
?>
</span>
</label>
</div>
</fieldset>
<?php
$estimates = get_post_meta($post_id, 'add_line_item_to_estimate', false);
$invoice_field = $pod->fields['add_line_item_to_estimate'];
$estimate_ids = array();
if (!empty($estimates)) {
foreach ($estimates as $estimate) {
$estimate_ids[] = $estimate['ID'];
}
}
$pod_field = PodsForm::field("add_line_item_to_estimate", $estimate_ids, 'pick', $invoice_field, $pod, $pod->id());
?>
<fieldset class="inline-edit-col-left">
<div class="inline-edit-col">
<label>
<span class="title">Estimates</span>
<span id="add_line_item_to_estimate" class="input-text-wrap"><?php
echo $pod_field;
?>
//.........这里部分代码省略.........
开发者ID:danielbachhuber,项目名称:marcgratch.com,代码行数:101,代码来源:manage_wordpress_posts_using_bulk_edit_and_quick_edit.php
示例15: ajax_import_export
/**
* Handle the Import/Export AJAX
*
* @param $params
*/
public function ajax_import_export($params)
{
if ('import' == $params->import_export) {
$data = trim($params->import_package);
$content = '<div class="pods-wizard-content">';
if (!empty($data)) {
$imported = $this->import($data);
if (!empty($imported)) {
$content .= '<p>Import Complete! The following items were imported:</p>';
foreach ($imported as $type => $import) {
$content .= '<h4>' . ucwords($type) . '</h4>';
$content .= '<ul class="normal">';
foreach ($import as $k => $what) {
$content .= '<li>' . esc_html($what) . '</li>';
}
$content .= '</ul>';
}
}
} else {
$content .= '<p>Import Error: Invalid Package</p>';
}
$content .= '</div>';
echo $content;
} elseif ('export' == $params->import_export) {
$params = get_object_vars($params);
foreach ($params as $k => $v) {
if (is_array($v)) {
$params[$k] = array_keys(array_filter($v));
}
}
$package = $this->export($params);
echo '<div class="pods-field-option">';
echo PodsForm::field('export_package', $package, 'paragraph', array('attributes' => array('style' => 'width: 94%; max-width: 94%; height: 300px;')));
echo '</div>';
}
}