Skip to content

Commit

Permalink
Blaze: avoid errors when post type label is not available (#31595)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve authored Jun 27, 2023
1 parent 531624e commit df45c6b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Avoid errors when the post type label is not defined.
2 changes: 1 addition & 1 deletion projects/packages/blaze/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@automattic/jetpack-blaze",
"version": "0.7.0",
"version": "0.7.1-alpha",
"description": "Attract high-quality traffic to your site using Blaze. Using this service, you can advertise a post or page on some of the millions of pages across WordPress.com and Tumblr from just $5 per day.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/blaze/#readme",
"bugs": {
Expand Down
2 changes: 1 addition & 1 deletion projects/packages/blaze/src/class-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Dashboard {
*
* @var string
*/
const PACKAGE_VERSION = '0.7.0';
const PACKAGE_VERSION = '0.7.1-alpha';

/**
* List of dependencies needed to render the dashboard in wp-admin.
Expand Down
6 changes: 4 additions & 2 deletions projects/packages/blaze/src/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useSelect } from '@wordpress/data';
import { PluginPostPublishPanel } from '@wordpress/edit-post';
import { store as editorStore } from '@wordpress/editor';
import { useCallback, useEffect } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { __, _x, sprintf } from '@wordpress/i18n';
import { external, Icon } from '@wordpress/icons';
import { getPlugin, registerPlugin } from '@wordpress/plugins';
import './editor.scss';
Expand All @@ -28,7 +28,9 @@ const BlazePostPublishPanel = () => {
isPublishingPost: selector( editorStore ).isPublishingPost(),
postId: selector( editorStore ).getCurrentPostId(),
postType: selector( editorStore ).getCurrentPostType(),
postTypeLabel: selector( editorStore ).getPostTypeLabel(),
postTypeLabel:
// Translators: default post type label.
selector( editorStore ).getPostTypeLabel() || _x( 'Post', 'noun', 'jetpack-blaze' ),
postVisibility: selector( editorStore ).getEditedPostVisibility(),
} ) );
const wasPublishing = usePrevious( isPublishingPost );
Expand Down

0 comments on commit df45c6b

Please sign in to comment.