Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions includes/core/classes/blocks/class-event-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,19 @@
true === $parsed_block['attrs']['query']['inherit']
) {
global $wp_query;
error_log( 'Event_Query::pre_render_block - Inheriting query' );

Check warning on line 106 in includes/core/classes/blocks/class-event-query.php

View workflow job for this annotation

GitHub Actions / wp-org-plugin-guidelines

WordPress.PHP.DevelopmentFunctions.error_log_error_log

error_log() found. Debug code should not normally be used in production.
error_log( 'Event_Query::pre_render_block - Parsed block attrs: ' . print_r( $parsed_block['attrs'], true ) );

Check warning on line 107 in includes/core/classes/blocks/class-event-query.php

View workflow job for this annotation

GitHub Actions / wp-org-plugin-guidelines

WordPress.PHP.DevelopmentFunctions.error_log_print_r

print_r() found. Debug code should not normally be used in production.

Check warning on line 107 in includes/core/classes/blocks/class-event-query.php

View workflow job for this annotation

GitHub Actions / wp-org-plugin-guidelines

WordPress.PHP.DevelopmentFunctions.error_log_error_log

error_log() found. Debug code should not normally be used in production.
error_log( 'Event_Query::pre_render_block - Original WP_Query args: ' . print_r( $wp_query->query_vars, true ) );

Check warning on line 108 in includes/core/classes/blocks/class-event-query.php

View workflow job for this annotation

GitHub Actions / wp-org-plugin-guidelines

WordPress.PHP.DevelopmentFunctions.error_log_print_r

print_r() found. Debug code should not normally be used in production.

Check warning on line 108 in includes/core/classes/blocks/class-event-query.php

View workflow job for this annotation

GitHub Actions / wp-org-plugin-guidelines

WordPress.PHP.DevelopmentFunctions.error_log_error_log

error_log() found. Debug code should not normally be used in production.

$query_args = array_merge(
$wp_query->query_vars,
array(
'posts_per_page' => $parsed_block['attrs']['query']['perPage'],
'order' => $parsed_block['attrs']['query']['order'],
'orderby' => $parsed_block['attrs']['query']['orderBy'],
'posts_per_page' => $parsed_block['attrs']['query']['perPage'],
'order' => $parsed_block['attrs']['query']['order'],
'orderby' => $parsed_block['attrs']['query']['orderBy'],
'gatherpress_event_query' => $parsed_block['attrs']['query']['gatherpress_event_query'],
'include_unfinished' => $parsed_block['attrs']['query']['include_unfinished'],

)
);

Expand All @@ -135,6 +141,7 @@
// "Hijack the global query. It's a hack, but it works." Ryan Welcher.
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$wp_query = new WP_Query( $filtered_query_args );
error_log( 'Event_Query::pre_render_block - Modified WP_Query args: ' . print_r( $wp_query->query_vars, true ) );

Check warning on line 144 in includes/core/classes/blocks/class-event-query.php

View workflow job for this annotation

GitHub Actions / wp-org-plugin-guidelines

WordPress.PHP.DevelopmentFunctions.error_log_print_r

print_r() found. Debug code should not normally be used in production.

Check warning on line 144 in includes/core/classes/blocks/class-event-query.php

View workflow job for this annotation

GitHub Actions / wp-org-plugin-guidelines

WordPress.PHP.DevelopmentFunctions.error_log_error_log

error_log() found. Debug code should not normally be used in production.
} else {
add_filter(
'query_loop_block_query_vars',
Expand Down
Loading