Skip to content

Commit

Permalink
Add show_flag attribute
Browse files Browse the repository at this point in the history
trymebytes committed Sep 2, 2024
1 parent a46621b commit c6985b2
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
if ( empty( $event_ids ) ) {
return get_no_result_view();
}

$show_flag = $attributes['show_flag'] ?? false;
ob_start();
?>
<div class="wp-block-wporg-event-list">
@@ -25,7 +25,13 @@
<!-- wp:wporg-translate-events-2024/event-template <?php echo wp_json_encode( array( 'id' => $event_id ) ); ?> -->
<div>
<!-- wp:wporg-translate-events-2024/event-title /-->
<?php
if ( $show_flag ) :
?>
<!-- wp:wporg-translate-events-2024/event-flag /-->
<?php
endif;
?>
</div>
<!-- wp:wporg-translate-events-2024/event-attendance-mode /-->
<!-- wp:wporg-translate-events-2024/event-start /-->
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
namespace Wporg\TranslationEvents\Theme_2024;

$event_ids = $attributes['event_ids'] ?? array();

$data = array(
'event_ids' => $event_ids,
'show_flag' => true,
);
?>
<!-- wp:wporg-translate-events-2024/event-list <?php echo wp_json_encode( array( 'event_ids' => $event_ids ) ); ?> /-->
<!-- wp:wporg-translate-events-2024/event-list <?php echo wp_json_encode( $data ); ?> /-->

0 comments on commit c6985b2

Please sign in to comment.