attributes() публичный статический Метод

Output a field's attributes
С версии: 2.0
public static attributes ( $attributes, $name = null, $type = null, $options = null )
<?php

$type = 'textarea';
$attributes = array();
$attributes['tabindex'] = 2;
$attributes = PodsForm::merge_attributes($attributes, $name, $form_field_type, $options);
if (pods_var('readonly', $options, false)) {
    $attributes['readonly'] = 'READONLY';
    $attributes['class'] .= ' pods-form-ui-read-only';
}
?>
    <textarea<?php 
PodsForm::attributes($attributes, $name, $form_field_type, $options);
?>
><?php 
echo esc_textarea($value);
?>
</textarea>
<?php 
PodsForm::regex($form_field_type, $options);
Пример #2
0
    $plupload_init['filters'][0]['extensions'] = $limit_types;
}
if (is_admin() && !empty($post_ID)) {
    $plupload_init['multipart_params']['post_id'] = (int) $post_ID;
} elseif (is_object($pod) && in_array($pod->pod_data['type'], array('post_type', 'media')) && 0 < $id) {
    $plupload_init['multipart_params']['post_id'] = (int) $id;
}
$plupload_init = apply_filters('plupload_init', $plupload_init);
if (empty($value)) {
    $value = array();
} else {
    $value = (array) $value;
}
?>
<div<?php 
PodsForm::attributes(array('class' => $attributes['class'], 'id' => $attributes['id']), $name, $form_field_type, $options);
?>
>
    <ul class="pods-files pods-files-list"><?php 
// no extra space in ul or CSS:empty won't work
foreach ($value as $val) {
    $attachment = get_post($val);
    if (empty($attachment)) {
        continue;
    }
    $thumb = wp_get_attachment_image_src($val, 'thumbnail', true);
    $title = $attachment->post_title;
    if (0 == $title_editable) {
        $title = basename($attachment->guid);
    }
    echo $field_file->markup($attributes, $file_limit, $title_editable, $val, $thumb[0], $title);
<label<?php 
PodsForm::attributes($attributes, $name, 'label');
?>
>
    <?php 
echo $label;
if (1 == pods_var('required', $options, pods_var('options', $options, $options))) {
    echo ' <abbr title="required" class="required">*</abbr>';
}
if (0 == pods_var('grouped', $options, 0, null, true) && !empty($help) && 'help' != $help) {
    pods_help($help);
}
?>
</label>
Пример #4
0
            <?php 
    } else {
        $option_label = (string) $option_label;
        $selected = '';
        $options['selected'] = '';
        if (!$selection_made && (!is_array($value) && (string) $option_value === (string) $value || is_array($value) && (in_array($option_value, $value) || in_array((string) $option_value, $value)))) {
            $selected = ' SELECTED';
            $options['selected'] = 'selected';
            if (!$multiple) {
                $selection_made = true;
            }
        }
        if (is_array($option_value)) {
            ?>
                <option<?php 
            PodsForm::attributes($option_value, $name, $form_field_type . '_option', $options);
            ?>
><?php 
            echo esc_html($option_label);
            ?>
</option>
                <?php 
        } else {
            ?>
                <option value="<?php 
            echo esc_attr($option_value);
            ?>
"<?php 
            echo $selected;
            ?>
><?php 
<p<?php 
PodsForm::attributes($attributes, $name, $type, $options);
?>
>
    <?php 
echo $message;
?>
</p>