Skip to content

Commit

Permalink
Only set type variable if editPostType is set
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed Feb 8, 2023
1 parent 9659d1d commit d51f656
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ export default function Editor() {
[ context ]
);
const isReady = editedPostType !== undefined && editedPostId !== undefined;
const type =
editedPostType === 'wp_template'
? __( 'Template' )
: __( 'Template Part' );
let titleBreadcrumb;

let titleBreadcrumb;
if ( isReady && editedPost ) {
const type =
editedPostType === 'wp_template'
? __( 'Template' )
: __( 'Template Part' );
titleBreadcrumb = `${ editedPost.title?.rendered }${ type } ‹ `;
}

Expand Down

0 comments on commit d51f656

Please sign in to comment.