Use new code style
This commit is contained in:
@ -7,70 +7,70 @@
|
||||
?>
|
||||
<div class="wu-my-6">
|
||||
|
||||
<div class="wu-flex">
|
||||
<div class="wu-flex">
|
||||
|
||||
<div class="wu-w-1/3">
|
||||
<div class="wu-w-1/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wu-w-2/3">
|
||||
<div class="wu-w-2/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<button class="button" name="<?php echo esc_attr($field->id); ?>" id="<?php echo esc_attr($field->id); ?>" value="<?php echo wp_create_nonce($field->action); ?>">
|
||||
<?php echo $field->title; ?>
|
||||
</button>
|
||||
</label>
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<button class="button" name="<?php echo esc_attr($field->id); ?>" id="<?php echo esc_attr($field->id); ?>" value="<?php echo wp_create_nonce($field->action); ?>">
|
||||
<?php echo $field->title; ?>
|
||||
</button>
|
||||
</label>
|
||||
|
||||
<?php if ($field->desc) : ?>
|
||||
<?php if ($field->desc) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
$('#<?php echo esc_js($field->id); ?>').on('click', function(e) {
|
||||
$('#<?php echo esc_js($field->id); ?>').on('click', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
e.preventDefault();
|
||||
|
||||
var $this = $(this);
|
||||
var default_label = $this.html();
|
||||
var $this = $(this);
|
||||
var default_label = $this.html();
|
||||
|
||||
$this.html('...').attr('disabled', 'disabled');
|
||||
$this.html('...').attr('disabled', 'disabled');
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo esc_js(admin_url('admin-ajax.php?action=').$field->action); ?>",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
$.ajax({
|
||||
url: "<?php echo esc_js(admin_url('admin-ajax.php?action=') . $field->action); ?>",
|
||||
dataType: "json",
|
||||
success: function(response) {
|
||||
|
||||
$this.html(response.message);
|
||||
$this.html(response.message);
|
||||
|
||||
setTimeout(function() {
|
||||
$this.html(default_label).removeAttr('disabled');
|
||||
}, 4000);
|
||||
setTimeout(function() {
|
||||
$this.html(default_label).removeAttr('disabled');
|
||||
}, 4000);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
@ -7,44 +7,44 @@
|
||||
?>
|
||||
<div class="wu-my-6">
|
||||
|
||||
<div class="wu-flex">
|
||||
<div class="wu-flex">
|
||||
|
||||
<div class="wu-w-1/3">
|
||||
<div class="wu-w-1/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wu-w-2/3">
|
||||
<div class="wu-w-2/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<input type='hidden' value='0' name="<?php echo esc_attr($field->id); ?>">
|
||||
<input type='hidden' value='0' name="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<input <?php checked(wu_get_setting($field_slug)); ?> name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" id="<?php echo esc_attr($field->id); ?>" value="1">
|
||||
<input <?php checked(wu_get_setting($field_slug)); ?> name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" id="<?php echo esc_attr($field->id); ?>" value="1">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
<?php if ($field->desc) : ?>
|
||||
<?php if ($field->desc) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
|
||||
</div>
|
||||
|
@ -7,45 +7,45 @@
|
||||
?>
|
||||
<div class="wu-my-6">
|
||||
|
||||
<div class="wu-flex">
|
||||
<div class="wu-flex">
|
||||
|
||||
<div class="wu-w-1/3">
|
||||
<div class="wu-w-1/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wu-w-2/3">
|
||||
<div class="wu-w-2/3">
|
||||
|
||||
<input class="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="text" id="<?php echo esc_attr($field->id); ?>" class="regular-text" value="<?php echo wu_get_setting($field->id); ?>" placeholder="<?php echo $field->placeholder ? $field->placeholder : ''; ?>">
|
||||
<input class="field-<?php echo esc_attr($field->id); ?>" name="<?php echo esc_attr($field->id); ?>" type="text" id="<?php echo esc_attr($field->id); ?>" class="regular-text" value="<?php echo wu_get_setting($field->id); ?>" placeholder="<?php echo $field->placeholder ? $field->placeholder : ''; ?>">
|
||||
|
||||
<?php if ($field->desc) : ?>
|
||||
<?php if ($field->desc) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
(function($) {
|
||||
$(function() {
|
||||
// Add Color Picker to all inputs that have 'color-field' class
|
||||
$('.field-<?php echo esc_attr($field->id); ?>').wpColorPicker();
|
||||
});
|
||||
$(function() {
|
||||
// Add Color Picker to all inputs that have 'color-field' class
|
||||
$('.field-<?php echo esc_attr($field->id); ?>').wpColorPicker();
|
||||
});
|
||||
})(jQuery);
|
||||
</script>
|
||||
|
@ -6,6 +6,6 @@
|
||||
*/
|
||||
?>
|
||||
<div class="wu-m-0" id="<?php echo esc_attr($field->id); ?>" data-type="heading">
|
||||
<h3 class="wu-m-0 wu-my-2"><?php echo $field->title; ?></h3>
|
||||
<p class="wu-m-0 wu-my-2"><?php echo $field->desc; ?></p>
|
||||
<h3 class="wu-m-0 wu-my-2"><?php echo $field->title; ?></h3>
|
||||
<p class="wu-m-0 wu-my-2"><?php echo $field->desc; ?></p>
|
||||
</div>
|
||||
|
@ -5,6 +5,6 @@
|
||||
* @since 2.0.0
|
||||
*/
|
||||
?>
|
||||
<div data-target="<?php echo 'collapsible-'.$field_slug; ?>" class="wu-settings-heading-collapsible wu-col-sm-12 <?php echo isset($field['active']) && !$field['active'] ? 'wu-settings-heading-collapsible-disabled' : ''; ?>">
|
||||
<?php echo $field['title']; ?>
|
||||
<div data-target="<?php echo 'collapsible-' . $field_slug; ?>" class="wu-settings-heading-collapsible wu-col-sm-12 <?php echo isset($field['active']) && ! $field['active'] ? 'wu-settings-heading-collapsible-disabled' : ''; ?>">
|
||||
<?php echo $field['title']; ?>
|
||||
</div>
|
||||
|
@ -18,43 +18,46 @@ wp_enqueue_script('wu-field-button-upload', WP_Ultimo()->get_asset("wu-field-ima
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="<?php echo $field_slug; ?>"><?php echo $field['title']; ?></label></th>
|
||||
<th scope="row"><label for="<?php echo $field_slug; ?>"><?php echo $field['title']; ?></label></th>
|
||||
<td>
|
||||
|
||||
<?php $image_url = WU_Settings::get_logo('full', wu_get_setting($field_slug));
|
||||
<?php
|
||||
$image_url = WU_Settings::get_logo('full', wu_get_setting($field_slug));
|
||||
|
||||
if (!$image_url && isset($field['default'])) $image_url = $field['default'];
|
||||
if ( ! $image_url && isset($field['default'])) {
|
||||
$image_url = $field['default'];
|
||||
}
|
||||
|
||||
if ( $image_url ) {
|
||||
$image = '<img id="%s" src="%s" alt="%s" style="width:%s; height:auto">';
|
||||
printf(
|
||||
$image,
|
||||
$field_slug.'-preview',
|
||||
$image_url,
|
||||
get_bloginfo('name'),
|
||||
$field['width'].'px'
|
||||
);
|
||||
if ( $image_url ) {
|
||||
$image = '<img id="%s" src="%s" alt="%s" style="width:%s; height:auto">';
|
||||
printf(
|
||||
$image,
|
||||
$field_slug . '-preview',
|
||||
$image_url,
|
||||
get_bloginfo('name'),
|
||||
$field['width'] . 'px'
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
} ?>
|
||||
<br>
|
||||
|
||||
<br>
|
||||
<a href="#" class="button wu-field-button-upload" data-target="<?php echo $field_slug; ?>">
|
||||
<?php echo $field['button']; ?>
|
||||
</a>
|
||||
|
||||
<a href="#" class="button wu-field-button-upload" data-target="<?php echo $field_slug; ?>">
|
||||
<?php echo $field['button']; ?>
|
||||
</a>
|
||||
<a data-default="<?php echo $field['default']; ?>" href="#" class="button wu-field-button-upload-remove" data-target="<?php echo $field_slug; ?>">
|
||||
<?php _e('Remove Image', 'wp-ultimo'); ?>
|
||||
</a>
|
||||
|
||||
<a data-default="<?php echo $field['default']; ?>" href="#" class="button wu-field-button-upload-remove" data-target="<?php echo $field_slug; ?>">
|
||||
<?php _e('Remove Image', 'wp-ultimo'); ?>
|
||||
</a>
|
||||
<?php if ( ! empty($field['desc'])) : ?>
|
||||
<p class="description" id="<?php echo $field_slug; ?>-desc">
|
||||
<?php echo $field['desc']; ?>
|
||||
</p>
|
||||
|
||||
<?php if (!empty($field['desc'])) : ?>
|
||||
<p class="description" id="<?php echo $field_slug; ?>-desc">
|
||||
<?php echo $field['desc']; ?>
|
||||
</p>
|
||||
<input type="hidden" name="<?php echo $field_slug; ?>" id="<?php echo $field_slug; ?>" value="<?php echo wu_get_setting($field_slug) ? wu_get_setting($field_slug) : $field['default']; ?>">
|
||||
|
||||
<input type="hidden" name="<?php echo $field_slug; ?>" id="<?php echo $field_slug; ?>" value="<?php echo wu_get_setting($field_slug) ? wu_get_setting($field_slug) : $field['default']; ?>">
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -6,89 +6,82 @@
|
||||
*/
|
||||
?>
|
||||
<tr id="multiselect-<?php echo $field_slug; ?>">
|
||||
<th scope="row"><label for="<?php echo $field_slug; ?>"><?php echo $field['title']; ?></label> <?php echo WU_Util::tooltip($field['tooltip']); ?></th>
|
||||
<td>
|
||||
<th scope="row"><label for="<?php echo $field_slug; ?>"><?php echo $field['title']; ?></label> <?php echo WU_Util::tooltip($field['tooltip']); ?></th>
|
||||
<td>
|
||||
|
||||
<?php
|
||||
<?php
|
||||
|
||||
// Check if it was selected
|
||||
$settings = wu_get_setting($field_slug);
|
||||
// Check if it was selected
|
||||
$settings = wu_get_setting($field_slug);
|
||||
|
||||
if ($settings === false) {
|
||||
if ($settings === false) {
|
||||
$settings = isset($field['default']) ? $field['default'] : false;
|
||||
}
|
||||
|
||||
$settings = isset($field['default']) ? $field['default'] : false;
|
||||
/**
|
||||
* Allow multi-select
|
||||
*
|
||||
* @since 1.5.0
|
||||
*/
|
||||
|
||||
}
|
||||
$sortable_class = isset($field['sortable']) && $field['sortable'] ? 'wu-sortable' : '';
|
||||
|
||||
/**
|
||||
* Allow multi-select
|
||||
* @since 1.5.0
|
||||
*/
|
||||
// If sortable, merge settings and list of items
|
||||
if (isset($field['sortable']) && $field['sortable'] && $settings) {
|
||||
$_settings = $settings;
|
||||
|
||||
$sortable_class = isset($field['sortable']) && $field['sortable'] ? 'wu-sortable' : '';
|
||||
foreach ($_settings as $key => &$value) {
|
||||
if ( ! isset($field['options'][ $key ])) {
|
||||
unset($_settings[ $key ]);
|
||||
|
||||
// If sortable, merge settings and list of items
|
||||
if (isset($field['sortable']) && $field['sortable'] && $settings) {
|
||||
continue;
|
||||
} // end if;
|
||||
|
||||
$_settings = $settings;
|
||||
$value = $field['options'][ $key ];
|
||||
} // end foreach;
|
||||
|
||||
foreach ($_settings as $key => &$value) {
|
||||
$field['options'] = $_settings + $field['options'];
|
||||
} // end if;
|
||||
|
||||
if (!isset($field['options'][$key])) {
|
||||
?>
|
||||
|
||||
unset($_settings[$key]);
|
||||
<div class="row <?php echo $sortable_class; ?>">
|
||||
|
||||
continue;
|
||||
<?php
|
||||
/**
|
||||
* Loop the values
|
||||
*/
|
||||
foreach ($field['options'] as $field_value => $field_name) :
|
||||
|
||||
} // end if;
|
||||
// Check this setting
|
||||
$this_settings = isset($settings[ $field_value ]) ? $settings[ $field_value ] : false;
|
||||
|
||||
$value = $field['options'][$key];
|
||||
?>
|
||||
|
||||
} // end foreach;
|
||||
<div class="wu-col-sm-4" style="margin-bottom: 2px;">
|
||||
|
||||
$field['options'] = $_settings + $field['options'];
|
||||
<label for="multiselect-<?php echo $field_value; ?>">
|
||||
<input <?php checked($this_settings); ?> name="<?php printf('%s[%s]', $field_slug, $field_value); ?>" type="checkbox" id="multiselect-<?php echo $field_value; ?>" value="1">
|
||||
<?php echo $field_name; ?>
|
||||
</label>
|
||||
|
||||
} // end if;
|
||||
</div>
|
||||
|
||||
?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<div class="row <?php echo $sortable_class; ?>">
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Loop the values
|
||||
*/
|
||||
foreach ($field['options'] as $field_value => $field_name) :
|
||||
<button type="button" data-select-all="multiselect-<?php echo $field_slug; ?>" class="button wu-select-all"><?php _e('Check / Uncheck All', 'wp-ultimo'); ?></button>
|
||||
|
||||
// Check this setting
|
||||
$this_settings = isset($settings[$field_value]) ? $settings[$field_value] : false;
|
||||
<br>
|
||||
|
||||
?>
|
||||
<?php if ( ! empty($field['desc'])) : ?>
|
||||
|
||||
<div class="wu-col-sm-4" style="margin-bottom: 2px;">
|
||||
<p class="description" id="<?php echo $field_slug; ?>-desc">
|
||||
<?php echo $field['desc']; ?>
|
||||
</p>
|
||||
|
||||
<label for="multiselect-<?php echo $field_value; ?>">
|
||||
<input <?php checked($this_settings); ?> name="<?php echo sprintf('%s[%s]', $field_slug, $field_value); ?>" type="checkbox" id="multiselect-<?php echo $field_value; ?>" value="1">
|
||||
<?php echo $field_name; ?>
|
||||
</label>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<button type="button" data-select-all="multiselect-<?php echo $field_slug; ?>" class="button wu-select-all"><?php _e('Check / Uncheck All', 'wp-ultimo'); ?></button>
|
||||
|
||||
<br>
|
||||
|
||||
<?php if (!empty($field['desc'])) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field_slug; ?>-desc">
|
||||
<?php echo $field['desc']; ?>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -7,38 +7,38 @@
|
||||
?>
|
||||
<div class="wu-my-6">
|
||||
|
||||
<div class="wu-flex">
|
||||
<div class="wu-flex">
|
||||
|
||||
<?php if ($field->title) : ?>
|
||||
<?php if ($field->title) : ?>
|
||||
|
||||
<div class="wu-w-1/3">
|
||||
<div class="wu-w-1/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="<?php echo esc_attr($field->title ? 'wu-w-2/3' : 'wu-w-full'); ?>">
|
||||
<div class="<?php echo esc_attr($field->title ? 'wu-w-2/3' : 'wu-w-full'); ?>">
|
||||
|
||||
<?php if ($field->desc) : ?>
|
||||
<?php if ($field->desc) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
|
||||
</div>
|
||||
|
@ -7,48 +7,48 @@
|
||||
?>
|
||||
<div class="wu-my-6">
|
||||
|
||||
<div class="wu-flex">
|
||||
<div class="wu-flex">
|
||||
|
||||
<div class="wu-w-1/3">
|
||||
<div class="wu-w-1/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wu-w-2/3">
|
||||
<div class="wu-w-2/3">
|
||||
|
||||
<select name="<?php echo esc_attr($field->id); ?>" id="<?php echo esc_attr($field->id); ?>" class="regular-text">
|
||||
<select name="<?php echo esc_attr($field->id); ?>" id="<?php echo esc_attr($field->id); ?>" class="regular-text">
|
||||
|
||||
<?php foreach ($field->options as $value => $option) : ?>
|
||||
<?php foreach ($field->options as $value => $option) : ?>
|
||||
|
||||
<option <?php selected(wu_get_setting($field->id), $value); ?> value="<?php echo esc_attr($value); ?>">
|
||||
<option <?php selected(wu_get_setting($field->id), $value); ?> value="<?php echo esc_attr($value); ?>">
|
||||
|
||||
<?php echo $option; ?>
|
||||
<?php echo $option; ?>
|
||||
|
||||
</option>
|
||||
</option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<?php if ($field->desc) : ?>
|
||||
<?php if ($field->desc) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
|
||||
</div>
|
||||
|
@ -18,22 +18,22 @@ $placeholder = isset($field['placeholder']) ? $field['placeholder'] : '';
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th scope="row"><label for="<?php echo $field_slug; ?>"><?php echo $field['title']; ?></label> <?php echo WU_Util::tooltip($field['tooltip']); ?> </th>
|
||||
<td>
|
||||
<th scope="row"><label for="<?php echo $field_slug; ?>"><?php echo $field['title']; ?></label> <?php echo WU_Util::tooltip($field['tooltip']); ?> </th>
|
||||
<td>
|
||||
|
||||
<select data-width="350px" multiple="multiple" placeholder="<?php echo $placeholder; ?>" class="wu-select" name="<?php echo $field_slug; ?>[]" id="<?php echo $field_slug; ?>">
|
||||
<select data-width="350px" multiple="multiple" placeholder="<?php echo $placeholder; ?>" class="wu-select" name="<?php echo $field_slug; ?>[]" id="<?php echo $field_slug; ?>">
|
||||
|
||||
<?php foreach ($field['options'] as $value => $option) : ?>
|
||||
<option <?php selected(in_array($value, $setting)); ?> value="<?php echo $value; ?>"><?php echo $option; ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($field['options'] as $value => $option) : ?>
|
||||
<option <?php selected(in_array($value, $setting)); ?> value="<?php echo $value; ?>"><?php echo $option; ?></option>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</select>
|
||||
</select>
|
||||
|
||||
<?php if (!empty($field['desc'])) : ?>
|
||||
<p class="description" id="<?php echo $field_slug; ?>-desc">
|
||||
<?php echo $field['desc']; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! empty($field['desc'])) : ?>
|
||||
<p class="description" id="<?php echo $field_slug; ?>-desc">
|
||||
<?php echo $field['desc']; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -7,42 +7,42 @@
|
||||
?>
|
||||
<div class="wu-my-6">
|
||||
|
||||
<div class="wu-flex">
|
||||
<div class="wu-flex">
|
||||
|
||||
<div class="wu-w-1/3">
|
||||
<div class="wu-w-1/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wu-w-2/3">
|
||||
<div class="wu-w-2/3">
|
||||
|
||||
<input <?php echo $field->html_attr ? $field->get_html_attributes() : ''; ?> <?php echo $field->disabled ? 'disabled="disabled"' : ''; ?> name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" id="<?php echo esc_attr($field->id); ?>" class="regular-text" value="<?php echo wu_get_setting($field->id); ?>" placeholder="<?php echo $field->placeholder ? $field->placeholder : ''; ?>">
|
||||
<input <?php echo $field->html_attr ? $field->get_html_attributes() : ''; ?> <?php echo $field->disabled ? 'disabled="disabled"' : ''; ?> name="<?php echo esc_attr($field->id); ?>" type="<?php echo esc_attr($field->type); ?>" id="<?php echo esc_attr($field->id); ?>" class="regular-text" value="<?php echo wu_get_setting($field->id); ?>" placeholder="<?php echo $field->placeholder ? $field->placeholder : ''; ?>">
|
||||
|
||||
<?php if (isset($field->append) && !empty($field->append)) : ?>
|
||||
<?php if (isset($field->append) && ! empty($field->append)) : ?>
|
||||
|
||||
<?php echo $field->append; ?>
|
||||
<?php echo $field->append; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($field->desc) : ?>
|
||||
<?php if ($field->desc) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
|
||||
</div>
|
||||
|
@ -7,36 +7,36 @@
|
||||
?>
|
||||
<div class="wu-my-6">
|
||||
|
||||
<div class="wu-flex">
|
||||
<div class="wu-flex">
|
||||
|
||||
<div class="wu-w-1/3">
|
||||
<div class="wu-w-1/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wu-w-2/3">
|
||||
<div class="wu-w-2/3">
|
||||
|
||||
<textarea cols="60" rows="7" name="<?php echo esc_attr($field->id); ?>" id="<?php echo esc_attr($field->id); ?>" class="regular-text" placeholder="<?php echo $field->placeholder ? esc_attr($field->placeholder) : ''; ?>"><?php echo esc_textarea(stripslashes(wu_get_setting($field_slug))); ?></textarea>
|
||||
<textarea cols="60" rows="7" name="<?php echo esc_attr($field->id); ?>" id="<?php echo esc_attr($field->id); ?>" class="regular-text" placeholder="<?php echo $field->placeholder ? esc_attr($field->placeholder) : ''; ?>"><?php echo esc_textarea(stripslashes(wu_get_setting($field_slug))); ?></textarea>
|
||||
|
||||
<?php if ($field->desc) : ?>
|
||||
<?php if ($field->desc) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
|
||||
</div>
|
||||
|
@ -7,40 +7,40 @@
|
||||
?>
|
||||
<div class="wu-my-6">
|
||||
|
||||
<div class="wu-flex">
|
||||
<div class="wu-flex">
|
||||
|
||||
<div class="wu-w-1/3">
|
||||
<div class="wu-w-1/3">
|
||||
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
<label for="<?php echo esc_attr($field->id); ?>">
|
||||
|
||||
<?php echo $field->title; ?>
|
||||
<?php echo $field->title; ?>
|
||||
|
||||
</label>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="wu-w-2/3">
|
||||
<div class="wu-w-2/3">
|
||||
|
||||
<div style="max-width: 800px;">
|
||||
<div style="max-width: 800px;">
|
||||
|
||||
<?php wp_editor(wu_get_setting($field->id), $field->id, $field->args); ?>
|
||||
<?php wp_editor(wu_get_setting($field->id), $field->id, $field->args); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($field->desc) : ?>
|
||||
<?php if ($field->desc) : ?>
|
||||
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
<p class="description" id="<?php echo $field->id; ?>-desc">
|
||||
|
||||
<?php echo $field->desc; ?>
|
||||
<?php echo $field->desc; ?>
|
||||
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
<?php // if (isset($field['tooltip'])) {echo WU_Util::tooltip($field['tooltip']);} ?>
|
||||
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user