Skip to content

Commit

Permalink
Merge pull request #493 from GatherPress/fix-venue
Browse files Browse the repository at this point in the history
Fix venue block bug.
  • Loading branch information
mauteri authored Jan 18, 2024
2 parents 42faa8b + 7d75aeb commit fe9022b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 42 deletions.
2 changes: 1 addition & 1 deletion build/blocks/venue/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('moment', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '9ce6288f6c94e001d316');
<?php return array('dependencies' => array('moment', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n'), 'version' => '6692e0824a5218385b23');
2 changes: 1 addition & 1 deletion build/blocks/venue/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/panels.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('moment', 'react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '14b23d93c2aed50cd77e');
<?php return array('dependencies' => array('moment', 'react', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-date', 'wp-edit-post', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => 'd5f7e9bb0b0f0d00eef8');
2 changes: 1 addition & 1 deletion build/panels.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion includes/core/classes/class-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ protected function localize( int $post_id ): array {
'is_admin' => is_admin(),
'nonce' => wp_create_nonce( 'wp_rest' ),
'post_id' => $post_id,
'post_type' => Event::POST_TYPE,
'settings' => array(
'date_format' => $settings->get_value( 'general', 'formatting', 'date_format' ),
'time_format' => $settings->get_value( 'general', 'formatting', 'time_format' ),
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/venue.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Internal dependencies.
* WordPress dependencies.
*/
import { getFromGlobal } from './globals';
import { select } from '@wordpress/data';

/**
* Check if the current post type is a venue.
Expand All @@ -14,5 +14,5 @@ import { getFromGlobal } from './globals';
* @return {boolean} True if the current post type is a venue; false otherwise.
*/
export function isVenuePostType() {
return 'gp_venue' === getFromGlobal('post_type');
return 'gp_venue' === select('core/editor').getCurrentPostType();
}
34 changes: 0 additions & 34 deletions test/unit/js/src/helpers/venue.test.js

This file was deleted.

0 comments on commit fe9022b

Please sign in to comment.