Skip to content

Commit

Permalink
if no featured image don't show button
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Draganescu committed Mar 13, 2022
1 parent 6d563d8 commit 8209a5d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/edit-post/src/hooks/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@ const addFeaturedImageToolbarItem = createHigherOrderComponent(
}
}, [ mediaUrl ] );

if ( 'core/image' !== blockName && 'core/cover' !== blockName ) {
if (
( 'core/image' !== blockName && 'core/cover' !== blockName ) ||
! mediaUrl
) {
return <BlockEdit { ...props } />;
}
return (
<>
<BlockControls group="other">
<ToolbarButton
icon={ group }
icon={ group /*this is temporary*/ }
label={ __( 'Use featured image' ) }
onClick={ () => {
setBindFeaturedImage( ! bindFeaturedImage );
Expand Down

0 comments on commit 8209a5d

Please sign in to comment.