Use PHP 7.4 featers and PHP 8 polyfills
This commit is contained in:
@ -25,13 +25,13 @@ if (isset($should_display) && ! $should_display) {
|
||||
return;
|
||||
} // end if;
|
||||
|
||||
$sites = array_map('wu_get_site', isset($sites) ? $sites : array());
|
||||
$sites = array_map('wu_get_site', $sites ?? []);
|
||||
|
||||
$categories = isset($categories) ? $categories : array();
|
||||
$categories ??= [];
|
||||
|
||||
$customer_sites_category = __('Your Sites', 'wp_ultimo');
|
||||
|
||||
$customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) : array();
|
||||
$customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites) : [];
|
||||
|
||||
?>
|
||||
|
||||
@ -82,7 +82,7 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
|
||||
|
||||
</ul>
|
||||
|
||||
<div id="wu-site-template-container-grid" class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo isset($cols) ? $cols : '3'; ?> wu-gap-4">
|
||||
<div id="wu-site-template-container-grid" class="wu-grid wu-grid-cols-1 sm:wu-grid-cols-2 md:wu-grid-cols-<?php echo $cols ?? '3'; ?> wu-gap-4">
|
||||
|
||||
<?php foreach ($sites as $site_template) : ?>
|
||||
|
||||
@ -93,7 +93,7 @@ $customer_sites = isset($customer_sites) ? array_map('intval', $customer_sites)
|
||||
|
||||
<?php $is_template = $site_template->get_type() === 'site_template'; ?>
|
||||
|
||||
<?php $categories = array_merge($site_template->get_categories(), ! $is_template ? array($customer_sites_category) : array()); ?>
|
||||
<?php $categories = array_merge($site_template->get_categories(), ! $is_template ? [$customer_sites_category] : []); ?>
|
||||
|
||||
<div
|
||||
id="wu-site-template-<?php echo esc_attr($site_template->get_id()); ?>"
|
||||
|
Reference in New Issue
Block a user