I’m also interested to see this as an option. Maybe to be able to set it via theme.json ? Unfortunately it seems its now not possible to override since wordpress’s code set the attribute to true when the file type is pdf:
File: wp-includes/js/dist/block-library.js . See “displayPreview”
function onSelectFile(newMedia) {
if (newMedia && newMedia.url) {
setHasError(false);
const isPdf = newMedia.url.endsWith('.pdf');
setAttributes({
href: newMedia.url,
fileName: newMedia.title,
textLinkHref: newMedia.url,
id: newMedia.id,
displayPreview: isPdf ? true : undefined,
previewHeight: isPdf ? 600 : undefined
});
}
-
This reply was modified 3 years, 3 months ago by jorinde88.