Use emojii flags

This commit is contained in:
David Stone
2025-02-15 14:57:51 -07:00
parent 3113413c3d
commit 6d7e7cef66
6 changed files with 24 additions and 3660 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

2
assets/js/flags.js Normal file
View File

@ -0,0 +1,2 @@
import { polyfillCountryFlagEmojis } from "https://cdn.skypack.dev/country-flag-emoji-polyfill";
polyfillCountryFlagEmojis();

View File

@ -525,6 +525,8 @@ class Dashboard_Admin_Page extends Base_Admin_Page {
wp_enqueue_style('wu-apex-charts', wu_get_asset('apexcharts.css', 'css'), [], wu_get_version()); wp_enqueue_style('wu-apex-charts', wu_get_asset('apexcharts.css', 'css'), [], wu_get_version());
wp_enqueue_style('wu-flags'); wp_enqueue_style('wu-flags');
wp_enqueue_script_module('wu-flags-polyfill');
} }
/** /**

View File

@ -25,7 +25,7 @@ foreach ($countries as $country_code => $count) {
]; ];
$data[] = $line; $data[] = $line;
} // end foreach; }
$page->render_csv_button( $page->render_csv_button(
[ [
@ -49,8 +49,8 @@ $page->render_csv_button(
<thead> <thead>
<tr> <tr>
<th><?php _e('Country', 'wp-ultimo'); ?></th> <th><?php esc_html_e('Country', 'wp-ultimo'); ?></th>
<th class="wu-text-right"><?php _e('Customer Count', 'wp-ultimo'); ?></th> <th class="wu-text-right"><?php esc_html_e('Customer Count', 'wp-ultimo'); ?></th>
</tr> </tr>
</thead> </thead>
@ -63,15 +63,15 @@ $page->render_csv_button(
<?php <?php
printf( printf(
'<span class="wu-flag-icon wu-flag-icon-%s wu-w-5 wu-mr-1" %s></span>', '<span class="wu-flag-icon wu-w-5 wu-mr-1" %s>%s</span>',
strtolower($country_code), wu_tooltip_text(wu_get_country_name($country_code)), // phpcs:ignore WordPress.Security.EscapeOutput
wu_tooltip_text(wu_get_country_name($country_code)) esc_html(wu_get_flag_emoji($country_code)),
); );
?> ?>
<?php echo wu_get_country_name($country_code); ?> <?php echo esc_html(wu_get_country_name($country_code)); ?>
</td> </td>
<td class="wu-text-right"><?php echo $count; ?></td> <td class="wu-text-right"><?php echo esc_html($count); ?></td>
</tr> </tr>
<?php <?php
@ -87,8 +87,8 @@ $page->render_csv_button(
?> ?>
<tr> <tr>
<td class="wu-text-xs">|&longrightarrow; <?php echo $state; ?></td> <td class="wu-text-xs">|&longrightarrow; <?php echo esc_html($state); ?></td>
<td class="wu-text-right"><?php echo $state_count; ?></td> <td class="wu-text-right"><?php echo esc_html($state_count); ?></td>
</tr> </tr>
<?php endforeach; ?> <?php endforeach; ?>
@ -96,8 +96,8 @@ $page->render_csv_button(
<?php if ($state_list && $count - $_state_count >= 0) : ?> <?php if ($state_list && $count - $_state_count >= 0) : ?>
<tr> <tr>
<td class="wu-text-xs">|&longrightarrow; <?php _e('Other', 'wp-ultimo'); ?></td> <td class="wu-text-xs">|&longrightarrow; <?php esc_html_e('Other', 'wp-ultimo'); ?></td>
<td class="wu-text-right"><?php echo $count - $_state_count; ?></td> <td class="wu-text-right"><?php echo esc_html($count - $_state_count); ?></td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
@ -114,7 +114,7 @@ $page->render_csv_button(
<div class="wu-bg-gray-100 wu-p-4 wu-rounded wu-mt-6"> <div class="wu-bg-gray-100 wu-p-4 wu-rounded wu-mt-6">
<?php _e('No countries registered yet.', 'wp-ultimo'); ?> <?php esc_html_e('No countries registered yet.', 'wp-ultimo'); ?>
</div> </div>