Skip to content

Commit

Permalink
External Media: do not display buttons in caption field. (#37987)
Browse files Browse the repository at this point in the history
Fixes #37943
  • Loading branch information
jeherve authored Jun 25, 2024
1 parent ebc143a commit 27dd8db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/fix-external-media-caption
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: bugfix

External Media: do not display External Media options in the Caption edit field.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ if ( isCurrentUserConnected() && 'function' === typeof useBlockEditContext ) {
const { name } = useBlockEditContext();
let { render } = props;

if ( isAllowedBlock( name, render ) || isFeaturedImage( props ) ) {
if (
( props?.mode === 'browse' && isAllowedBlock( name, render ) ) ||
isFeaturedImage( props )
) {
const { allowedTypes, gallery = false, value = [] } = props;

// Only replace button for components that expect images, except existing galleries.
Expand Down

0 comments on commit 27dd8db

Please sign in to comment.