1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00

add error handling

This commit is contained in:
Daniel Waxweiler
2023-05-07 21:48:33 +02:00
parent 091317a532
commit d79a0cf9a6
9 changed files with 111 additions and 29 deletions

View File

@ -0,0 +1,9 @@
<?php
// Exit if this file is called directly.
if (!defined('ABSPATH')) {
exit;
}
?>
<div class="<?php echo esc_attr($classNamePrefix); ?>_events-list-php">
<?php esc_html_e('The group could not be found!', 'connector-mobilizon'); ?>
</div>

View File

@ -0,0 +1,9 @@
<?php
// Exit if this file is called directly.
if (!defined('ABSPATH')) {
exit;
}
?>
<div class="<?php echo esc_attr($classNamePrefix); ?>_events-list-php">
<?php esc_html_e('The events could not be loaded!', 'connector-mobilizon'); ?>
</div>

View File

@ -5,10 +5,8 @@ if (!defined('ABSPATH')) {
}
?>
<div class="<?php echo esc_attr($classNamePrefix); ?>_events-list-php">
<div class="general-error" style="display: none;"><?php esc_html_e('The events could not be loaded!', 'connector-mobilizon'); ?></div>
<div class="group-not-found" style="display: none;"><?php esc_html_e('The group could not be found!', 'connector-mobilizon'); ?></div>
<ul>
<?php foreach($data['data']['events']['elements'] as $event) { ?>
<?php foreach($events as $event) { ?>
<li>
<a href="<?php echo esc_attr($event['url']); ?>"><?php echo esc_html_e($event['title']); ?></a>
<br>