Skip to content

Commit

Permalink
Following a little bug into a rabbit hole
Browse files Browse the repository at this point in the history
  • Loading branch information
carstingaxion committed Oct 16, 2024
1 parent df8f92b commit 95d4bb1
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 2 deletions.
75 changes: 75 additions & 0 deletions includes/core/classes/class-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public function register_blocks(): void {
*
* @since 1.0.0
* @see https://developer.wordpress.org/reference/functions/register_block_pattern/
* @see https://developer.wordpress.org/reference/classes/wp_block_patterns_registry/register/#parameters
*
* @return void
*/
Expand All @@ -103,6 +104,80 @@ public function register_block_patterns(): void {
'source' => 'plugin',
),
),



array(
'gatherpress/event-content-1',
array(
'title' => __( 'Event Content Starter Pattern 1', 'gatherpress' ),
'content' => '<!-- wp:paragraph -->
<p>hallo pattern 1</p>
<!-- /wp:paragraph -->',
// 'inserter' => false,
// 'source' => 'plugin',
// 'keywords' => array('starter'),
'blockTypes' => array( 'core/post-content' ),
'postTypes' => array( 'post', 'car', 'page', 'gatherpress_event' ),
// 'postTypes' => array( 'post', 'car', 'gatherpress_event', 'gatherpress_venue' ),
// 'templateTypes' => array( 'single-gatherpress_event' ),
),
),
array(
'gatherpress/event-content-2',
array(
'title' => __( 'Event Content Starter Pattern 2', 'gatherpress' ),
// 'content' => '<!-- wp:post-featured-image /--><!-- wp:pattern {"slug":"gatherpress/event-template"} /-->',
'content' => '<!-- wp:post-featured-image /--><!-- wp:paragraph -->
<p>hallo pattern 2</p>
<!-- /wp:paragraph -->',
// 'inserter' => false,
// 'source' => 'plugin',
// 'keywords' => array('starter'),
'blockTypes' => array( 'core/post-content' ),
'postTypes' => array( 'post', 'car', 'page', 'gatherpress_event' ),
// 'postTypes' => array( 'post', 'car', 'gatherpress_event', 'gatherpress_venue' ),
// 'templateTypes' => array( 'single-gatherpress_event' ),
),
),





/*
* WORKING
*
* Starter patterns for TEMPLATES
*
* ....
*
array(
'gatherpress/event-starter-1',
array(
'title' => __( 'Event Template Starter Pattern 1', 'gatherpress' ),
'description' => _x( 'This is my first starter pattern', 'Block pattern description', 'textdomain' ),
'content' => '<!-- wp:pattern {"slug":"gatherpress/event-template"} /-->',
'inserter' => false,
'source' => 'plugin',
// 'blockTypes' => array( 'core/post-content' ),
'postTypes' => array( 'gatherpress_event' ),
'templateTypes' => array( 'single-gatherpress_event' ),
),
),
array(
'gatherpress/event-starter-2',
array(
'title' => __( 'Event Template Starter Pattern 2', 'gatherpress' ),
'description' => _x( 'This is my second starter pattern', 'Block pattern description', 'textdomain' ),
'content' => '<!-- wp:post-featured-image /--><!-- wp:pattern {"slug":"gatherpress/event-template"} /-->',
'inserter' => false,
'source' => 'plugin',
// 'blockTypes' => array( 'core/post-content' ),
'postTypes' => array( 'gatherpress_event' ),
'templateTypes' => array( 'single-gatherpress_event' ),
),
), */
array(
'gatherpress/venue-template',
array(
Expand Down
2 changes: 1 addition & 1 deletion includes/core/classes/class-event-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ public function prepare_event_data( WP_REST_Response $response ): WP_REST_Respon
// - The user is attending the event.
// - The event is in the future.
// - The code is not in an admin context.
$response->data['meta']['online_event_link'] = $event->maybe_get_online_event_link();
// $response->data['meta']['online_event_link'] = $event->maybe_get_online_event_link();

return $response;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/core/classes/class-event-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function register_post_type(): void {
'thumbnail',
'comments',
'revisions',
'custom-fields',
// 'custom-fields',
),
'menu_icon' => 'dashicons-nametag',
'has_archive' => true,
Expand Down

0 comments on commit 95d4bb1

Please sign in to comment.