-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #353 from WordPress/manage-attendees-page-block
Manage attendees page block
- Loading branch information
Showing
7 changed files
with
104 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
themes/wporg-translate-events-2024/blocks/pages/events/event-attendees/index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
namespace Wporg\TranslationEvents\Theme_2024; | ||
|
||
register_block_type( | ||
'wporg-translate-events-2024/page-events-event-attendees', | ||
array( | ||
'render_callback' => function ( array $attributes ) { | ||
add_filter( | ||
'wporg_block_site_breadcrumbs', | ||
function ( $breadcrumbs ): array { | ||
return array_merge( | ||
$breadcrumbs, | ||
array( | ||
array( | ||
'title' => __( 'Manage Attendees', 'wporg-translate-events-2024' ), | ||
'url' => null, | ||
), | ||
) | ||
); | ||
} | ||
); | ||
|
||
render_page( | ||
__DIR__ . '/render.php', | ||
__( 'Manage Attendees', 'wporg-translate-events-2024' ), | ||
$attributes | ||
); | ||
}, | ||
) | ||
); |
23 changes: 23 additions & 0 deletions
23
themes/wporg-translate-events-2024/blocks/pages/events/event-attendees/render.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
namespace Wporg\TranslationEvents\Theme_2024; | ||
|
||
use Wporg\TranslationEvents\Translation_Events; | ||
|
||
$event_id = $attributes['event_id'] ?? array(); | ||
$event = Translation_Events::get_event_repository()->get_event( $event_id ); | ||
if ( ! $event ) { | ||
return ''; | ||
} | ||
|
||
?> | ||
<!-- wp:wporg-translate-events-2024/attendee-list | ||
<?php | ||
echo wp_json_encode( | ||
array( | ||
'id' => $event->id(), | ||
'view_type' => 'table', | ||
) | ||
); | ||
?> | ||
|
||
/--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters