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,76 +7,80 @@
?>
<li class="<?php echo esc_attr(trim($field->wrapper_classes)); ?>" <?php echo $field->get_wrapper_html_attributes(); ?>>
<div class="wu-block">
<div class="wu-block">
<?php
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-title', array(
'field' => $field,
));
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-title',
array(
'field' => $field,
)
);
?>
?>
<?php if ($field->type === 'date' || $field->date === true) : ?>
<?php if ($field->type === 'date' || $field->date === true) : ?>
<?php
<?php
if (wu_validate_date($field->value)) {
if (wu_validate_date($field->value)) {
$date = $field->value;
$date = $field->value;
$time = strtotime(get_date_from_gmt($date));
$time = strtotime(get_date_from_gmt($date));
$formatted_value = date_i18n(get_option('date_format'), $time);
$formatted_value = date_i18n(get_option('date_format'), $time);
$placeholder = wu_get_current_time('timestamp') > $time ? __('%s ago', 'wp-ultimo') : __('In %s', 'wp-ultimo'); // phpcs:ignore
echo sprintf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', $formatted_value, sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp'))), get_date_from_gmt($date));
printf('<time datetime="%3$s">%1$s</time><br><small>%2$s</small>', $formatted_value, sprintf($placeholder, human_time_diff($time, wu_get_current_time('timestamp'))), get_date_from_gmt($date));
} else {
_e('None', 'wp-ultimo');
} // end if;
} else {
?>
_e('None', 'wp-ultimo');
<?php else : ?>
} // end if;
<span class="wu-my-1 wu-inline-block">
?>
<span id="<?php echo $field->id; ?>_value"><?php echo $field->display_value; ?></span>
<?php else : ?>
<?php if ($field->copy) : ?>
<span class="wu-my-1 wu-inline-block">
<a <?php echo wu_tooltip_text(__('Copy', 'wp-ultimo')); ?> class="wu-no-underline wp-ui-text-highlight wu-copy" data-clipboard-action="copy" data-clipboard-target="#<?php echo $field->id; ?>_value">
<span id="<?php echo $field->id; ?>_value"><?php echo $field->display_value; ?></span>
<span class="dashicons-wu-copy wu-align-middle"></span>
<?php if ($field->copy) : ?>
</a>
<a <?php echo wu_tooltip_text(__('Copy', 'wp-ultimo')); ?> class="wu-no-underline wp-ui-text-highlight wu-copy" data-clipboard-action="copy" data-clipboard-target="#<?php echo $field->id; ?>_value">
<?php endif; ?>
<span class="dashicons-wu-copy wu-align-middle"></span>
</span>
</a>
<?php endif; ?>
<?php endif; ?>
<?php
</span>
/**
* Adds the partial title template.
*
* @since 2.0.0
*/
wu_get_template(
'admin-pages/fields/partials/field-description',
array(
'field' => $field,
)
);
<?php endif; ?>
?>
<?php
/**
* Adds the partial title template.
* @since 2.0.0
*/
wu_get_template('admin-pages/fields/partials/field-description', array(
'field' => $field,
));
?>
</div>
</div>
</li>