label() public static method

Output a field's label
Since: 2.0
public static label ( string $name, string $label, string $help = '', array $options = null ) : string
$name string Field name
$label string Label text
$help string Help text
$options array Field options
return string Label HTML
            $helpers = $api->load_helpers(array('options' => array('helper_type' => 'pre_delete')));
            foreach ($helpers as $helper) {
                $pre_delete_helpers[$helper['name']] = $helper['name'];
            }
            echo PodsForm::label('pre_delete_helpers', __('Pre-Delete Helper(s)', 'pods'), __('help', 'pods'));
            echo PodsForm::field('pre_delete_helpers', pods_var_raw('pre_delete_helpers', $pod), 'pick', array('data' => $pre_delete_helpers));
            ?>
    </div>
    <div class="pods-field-option">
        <?php 
            $post_delete_helpers = array('' => '-- Select --');
            $helpers = $api->load_helpers(array('options' => array('helper_type' => 'post_delete')));
            foreach ($helpers as $helper) {
                $post_delete_helpers[$helper['name']] = $helper['name'];
            }
            echo PodsForm::label('post_delete_helpers', __('Post-Delete Helper(s)', 'pods'), __('help', 'pods'));
            echo PodsForm::field('post_delete_helpers', pods_var_raw('post_delete_helpers', $pod), 'pick', array('data' => $post_delete_helpers));
            ?>
    </div>
    <?php 
        }
    }
    ?>
</div>
<?php 
}
foreach ($tabs as $tab => $tab_label) {
    $tab = sanitize_title($tab);
    if (in_array($tab, array('manage-fields', 'labels', 'advanced', 'extra-fields')) || !isset($tab_options[$tab]) || empty($tab_options[$tab])) {
        continue;
    }
Example #2
0
    ?>
    <div class="pods-field pods-boolean"<?php 
    echo $indent;
    ?>
>
        <input<?php 
    PodsForm::attributes($attributes, $name, $form_field_type, $options);
    ?>
 />
        <?php 
    if (0 < strlen($label)) {
        $help = pods_var_raw('help', $options);
        if (1 == pods_var('grouped', $options, 0, null, true) || empty($help)) {
            $help = '';
        }
        echo PodsForm::label($attributes['id'], $label, $help);
    }
    ?>
    </div>
    <?php 
    if (1 == pods_var('grouped', $options, 0, null, true)) {
        ?>
        </li>
<?php 
    }
    $counter++;
}
if (1 == pods_var('grouped', $options, 0, null, true)) {
    ?>
    </ul>
</div>
Example #3
0
}
?>

                                    <?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">
Example #4
0
    /**
     * @param $comment
     * @param $metabox
     */
    public function meta_comment($comment, $metabox)
    {
        wp_enqueue_style('pods-form');
        $hidden_fields = array();
        ?>
    <table class="form-table editcomment pods-metabox">
        <?php 
        $id = null;
        if (is_object($comment)) {
            $id = $comment->comment_ID;
        }
        $pod = pods($metabox['args']['group']['pod']['name'], $id, true);
        foreach ($metabox['args']['group']['fields'] as $field) {
            if (false === PodsForm::permission($field['type'], $field['name'], $field, $metabox['args']['group']['fields'], $pod, $id)) {
                if (pods_var('hidden', $field['options'], false, null, true)) {
                    $field['type'] = 'hidden';
                } else {
                    continue;
                }
            } elseif (!pods_has_permissions($field['options']) && pods_var('hidden', $field['options'], false, null, true)) {
                $field['type'] = 'hidden';
            }
            $value = '';
            if (!empty($pod)) {
                $value = $pod->field(array('name' => $field['name'], 'in_form' => true));
            }
            if ('hidden' == $field['type']) {
                $hidden_fields[] = array('field' => $field, 'value' => $value);
            } else {
                ?>
            <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_meta_' . $field['name'], $field['label'], $field['help'], $field);
                ?>
</th>
                <td>
                    <?php 
                echo PodsForm::field('pods_meta_' . $field['name'], $value, $field['type'], $field, $pod, $id);
                ?>
                    <?php 
                echo PodsForm::comment('pods_meta_' . $field['name'], $field['description'], $field);
                ?>
                </td>
            </tr>
        <?php 
            }
        }
        ?>
    </table>
<?php 
        foreach ($hidden_fields as $hidden_field) {
            $field = $hidden_field['field'];
            echo PodsForm::field('pods_meta_' . $field['name'], $hidden_field['value'], 'hidden');
        }
    }
Example #5
0
                            </h3>

                            <div class="inside">
                                <table class="form-table pods-metabox">
                                    <?php 
    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>
            echo $depends;
            ?>
">
                <?php 
        }
    }
    if (!is_array($field_option['group'])) {
        $value = pods_var_raw($field_name, $settings, $field_option['default']);
        ?>
                    <tr valign="top" class="pods-field-option" id="pods-setting-<?php 
        echo $field_name;
        ?>
">
                        <th>
                            <?php 
        echo PodsForm::label('pods_setting_' . $field_name, $field_option['label'], $field_option['help'], $field_option);
        ?>
                        </th>
                        <td>
                            <?php 
        echo PodsForm::field('pods_setting_' . $field_name, $value, $field_option['type'], $field_option);
        ?>
                        </td>
                    </tr>
                <?php 
    } else {
        ?>
                    <tr valign="top" class="pods-field-option-group" id="pods-setting-<?php 
        echo $field_name;
        ?>
">
Example #7
0
     * @params array $field The current field.
     * @params array $fields All fields of the form.
     * @params object $pod The current Pod object.
     * @params array $params The form's parameters.
     *
     * @since 2.3.19
     */
    do_action('pods_form_pre_field', $field, $fields, $pod, $params);
    ?>
					<li class="pods-field <?php 
    echo 'pods-form-ui-row-type-' . $field['type'] . ' pods-form-ui-row-name-' . PodsForm::clean($field['name'], true);
    ?>
">
						<div class="pods-field-label">
							<?php 
    echo PodsForm::label($field_prefix . $field['name'], $field['label'], $field['help'], $field);
    ?>
						</div>

						<div class="pods-field-input">
							<?php 
    echo PodsForm::field($field_prefix . $field['name'], $pod->field(array('name' => $field['name'], 'in_form' => true)), $field['type'], $field, $pod, $pod->id());
    ?>

							<?php 
    echo PodsForm::comment($field_prefix . $field['name'], null, $field);
    ?>
						</div>
					</li>
				<?php 
    /**
?>
                                </div>
                                <div class="pods-field-option pods-depends-on pods-depends-on-field-data-pick-object pods-depends-on-field-data-pick-object-table">
                                    <?php 
echo PodsForm::label('field_data[' . $pods_i . '][pick_table]', __('Related Table', 'pods'), __('help', 'pods'));
?>
                                    <?php 
echo PodsForm::field('field_data[' . $pods_i . '][pick_table]', pods_var_raw('pick_table', $field, ''), 'pick', array('required' => true, 'data' => pods_var_raw('pick_table', $field_settings)));
?>
                                </div>
                                <div class="pods-field-option pods-depends-on pods-depends-on-field-data-pick-object pods-depends-on-field-data-pick-object-<?php 
echo esc_attr(str_replace('_', '-', implode(' pods-depends-on-field-data-pick-object-', $bidirectional_objects)));
?>
" data-dependency-trigger="pods_sister_field">
                                    <?php 
echo PodsForm::label('field_data[' . $pods_i . '][sister_id]', __('Bi-directional Field', 'pods'), __('Bi-directional fields will update their related field for any item you select. This feature is only available for two relationships between two Pods.<br /><br />For example, when you update a Parent pod item to relate to a Child item, when you go to edit that Child item you will see the Parent pod item selected.', 'pods'));
?>

                                    <div class="pods-sister-field">
                                        <?php 
echo PodsForm::field('field_data[' . $pods_i . '][sister_id]', pods_var_raw('sister_id', $field, ''), 'text');
?>
                                    </div>
                                </div>
                            </div>
                            <div class="pods-field-option-group">
                                <p class="pods-field-option-group-label">
                                    <?php 
_e('Options', 'pods');
?>
                                </p>
Example #9
0
">
                                                    <?php 
    echo PodsForm::field('capabilities[' . $capability . ']', pods_var_raw('capabilities[' . $capability . ']', 'post', $checked), 'boolean', array('boolean_yes_label' => $capability));
    ?>
                                                </li>
                                                <?php 
}
?>
                                        </ul>
                                    </div>
                                </div>

                                <div class="pods-field-option-group">
                                    <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>
<?php

echo PodsForm::label($name, $options);
?>

<?php 
echo PodsForm::field($name, $value, $type, $options, $pod, $id);
?>

<?php 
echo PodsForm::comment($name, null, $options);