Use new code style

This commit is contained in:
David Stone
2025-02-07 19:02:33 -07:00
parent 0181024ae1
commit 8433379d90
672 changed files with 37107 additions and 45249 deletions

View File

@ -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>