Use PHP 7.4 featers and PHP 8 polyfills

This commit is contained in:
David Stone
2025-02-08 13:57:32 -07:00
parent 8bea6067cd
commit b41dc2b2eb
550 changed files with 15270 additions and 14627 deletions

View File

@ -21,7 +21,7 @@
<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 ?: ''; ?>">
<?php if ($field->desc) : ?>

View File

@ -55,7 +55,7 @@ wp_enqueue_script('wu-field-button-upload', WP_Ultimo()->get_asset("wu-field-ima
<?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) ?: $field['default']; ?>">
<?php endif; ?>

View File

@ -15,7 +15,7 @@
$settings = wu_get_setting($field_slug);
if ($settings === false) {
$settings = isset($field['default']) ? $field['default'] : false;
$settings = $field['default'] ?? false;
}
/**
@ -54,7 +54,7 @@
foreach ($field['options'] as $field_value => $field_name) :
// Check this setting
$this_settings = isset($settings[ $field_value ]) ? $settings[ $field_value ] : false;
$this_settings = $settings[ $field_value ] ?? false;
?>

View File

@ -9,9 +9,9 @@
$setting = wu_get_setting($field_slug);
$setting = is_array($setting) ? $setting : array();
$setting = is_array($setting) ? $setting : [];
$placeholder = isset($field['placeholder']) ? $field['placeholder'] : '';
$placeholder = $field['placeholder'] ?? '';
// WU_Scripts()->enqueue_select2();

View File

@ -21,7 +21,7 @@
<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 ?: ''; ?>">
<?php if (isset($field->append) && ! empty($field->append)) : ?>