Use new code style
This commit is contained in:
@ -15,48 +15,45 @@
|
||||
* @version 1.4.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- This example requires Tailwind CSS v2.0+ -->
|
||||
<nav aria-label="<?php esc_attr_e('Progress', 'wp-ultimo'); ?>">
|
||||
<ul class="wu-clean-steps wu-list-none md:wu-flex wu-p-0 wu--mx-2 wu-my-4">
|
||||
<ul class="wu-clean-steps wu-list-none md:wu-flex wu-p-0 wu--mx-2 wu-my-4">
|
||||
|
||||
|
||||
<?php foreach ($steps as $index => $step) :
|
||||
<?php
|
||||
foreach ($steps as $index => $step) :
|
||||
$step_key = $step['id'];
|
||||
|
||||
$step_key = $step['id'];
|
||||
/**
|
||||
* Class element of the Step Status Bar
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
$container_class = '';
|
||||
$color = 'gray';
|
||||
|
||||
/**
|
||||
* Class element of the Step Status Bar
|
||||
* @var string
|
||||
*/
|
||||
$container_class = '';
|
||||
$color = 'gray';
|
||||
if ($step_key === $current_step) {
|
||||
$color = 'blue';
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
$container_class = 'wu-opacity-50';
|
||||
$color = 'blue';
|
||||
} // end if;
|
||||
|
||||
if ($step_key === $current_step) {
|
||||
?>
|
||||
|
||||
$color = 'blue';
|
||||
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
|
||||
$container_class = 'wu-opacity-50';
|
||||
$color = 'blue';
|
||||
|
||||
} // end if;
|
||||
|
||||
?>
|
||||
|
||||
<li class="wu-py-0 md:wu-flex-1 wu-px-2 <?php echo esc_attr($container_class); ?>">
|
||||
<span class="wu-h-2 wu-block wu-mb-2 wu-bg-<?php echo esc_attr($color); ?>-500"> </span>
|
||||
<span class="wu-block wu-text-2xs wu-font-medium wu-tracking-wide wu-uppercase wu-text-<?php echo esc_attr($color); ?>-500"><?php printf(__('Step %d', 'wp-ultimo'), $index + 1); ?></span>
|
||||
<span class="wu-block wu-text-sm wu-font-medium wu-text-<?php echo esc_attr($color); ?>-600"><?php echo $step['name']; ?></span>
|
||||
</li>
|
||||
<li class="wu-py-0 md:wu-flex-1 wu-px-2 <?php echo esc_attr($container_class); ?>">
|
||||
<span class="wu-h-2 wu-block wu-mb-2 wu-bg-<?php echo esc_attr($color); ?>-500"> </span>
|
||||
<span class="wu-block wu-text-2xs wu-font-medium wu-tracking-wide wu-uppercase wu-text-<?php echo esc_attr($color); ?>-500"><?php printf(__('Step %d', 'wp-ultimo'), $index + 1); ?></span>
|
||||
<span class="wu-block wu-text-sm wu-font-medium wu-text-<?php echo esc_attr($color); ?>-600"><?php echo $step['name']; ?></span>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
</nav>
|
||||
|
@ -15,42 +15,39 @@
|
||||
* @version 1.4.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<ol class="wu-setup-steps wu-flex">
|
||||
|
||||
<?php foreach ($steps as $index => $step) :
|
||||
<?php
|
||||
foreach ($steps as $index => $step) :
|
||||
$step_key = $step['id'];
|
||||
|
||||
$step_key = $step['id'];
|
||||
/**
|
||||
* Class element of the Step Status Bar
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
$class = '';
|
||||
|
||||
/**
|
||||
* Class element of the Step Status Bar
|
||||
* @var string
|
||||
*/
|
||||
$class = '';
|
||||
if ($step_key === $current_step) {
|
||||
$class = 'active';
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
$class = 'done';
|
||||
} // end if;
|
||||
|
||||
if ($step_key === $current_step) {
|
||||
?>
|
||||
|
||||
$class = 'active';
|
||||
<li class="<?php echo $class; ?> wu-flex-1">
|
||||
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
<?php echo esc_html($step['name']); ?>
|
||||
|
||||
$class = 'done';
|
||||
</li>
|
||||
|
||||
} // end if;
|
||||
|
||||
?>
|
||||
|
||||
<li class="<?php echo $class; ?> wu-flex-1">
|
||||
|
||||
<?php echo esc_html($step['name']); ?>
|
||||
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ol>
|
||||
|
@ -15,46 +15,43 @@
|
||||
* @version 1.4.0
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
if ( ! defined('ABSPATH')) {
|
||||
exit; // Exit if accessed directly
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- This example requires Tailwind CSS v2.0+ -->
|
||||
<nav aria-label="<?php esc_attr_e('Progress', 'wp-ultimo'); ?>">
|
||||
<ul class="wu-minimal-steps">
|
||||
<ul class="wu-minimal-steps">
|
||||
|
||||
|
||||
<?php foreach ($steps as $index => $step) :
|
||||
<?php
|
||||
foreach ($steps as $index => $step) :
|
||||
$step_key = $step['id'];
|
||||
|
||||
$step_key = $step['id'];
|
||||
/**
|
||||
* Class element of the Step Status Bar
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
$class = '';
|
||||
|
||||
/**
|
||||
* Class element of the Step Status Bar
|
||||
* @var string
|
||||
*/
|
||||
$class = '';
|
||||
if ($step_key === $current_step) {
|
||||
$class = 'step-current';
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
$class = 'step-done';
|
||||
} // end if;
|
||||
|
||||
if ($step_key === $current_step) {
|
||||
?>
|
||||
|
||||
$class = 'step-current';
|
||||
|
||||
} elseif (array_search($current_step, array_column($steps, 'id')) > array_search($step_key, array_column($steps, 'id'))) {
|
||||
|
||||
$class = 'step-done';
|
||||
|
||||
} // end if;
|
||||
|
||||
?>
|
||||
|
||||
<li class="<?php echo esc_attr($class); ?>">
|
||||
<span class="wu-minimal-steps-bar"> </span>
|
||||
<span class="wu-minimal-steps-step-count"><?php printf(__('Step %d', 'wp-ultimo'), $index + 1); ?></span>
|
||||
<span class="wu-minimal-steps-step-label"><?php echo $step['name']; ?></span>
|
||||
</li>
|
||||
<li class="<?php echo esc_attr($class); ?>">
|
||||
<span class="wu-minimal-steps-bar"> </span>
|
||||
<span class="wu-minimal-steps-step-count"><?php printf(__('Step %d', 'wp-ultimo'), $index + 1); ?></span>
|
||||
<span class="wu-minimal-steps-step-label"><?php echo $step['name']; ?></span>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
</nav>
|
||||
|
Reference in New Issue
Block a user