• Resolved ccsmithwp

    (@ccsmithwp)


    As of Gutenberg 17.2.0, none of the pdf files on my site show their inline embeds. All that is shown is the text link and “Download” button, the same as if the “Show inline embed” setting in the editor was deselected.

    Showing a pdf inline is done by including an <object> in the code. As of 17.2.0, that object is still there, but with a hidden="" attribute included.

    The behaviour is the same even with all other plugins deactivated.

    Below is shown the <div> that includes the <object>. Note that there are three differences:

    • In 17.1.4, the div’s data-wp-interactiveattribute is empty; in 17.2.0 it is given a value.
    • The object’s data-wp-bind--hidden attribute changes from “!selectors…” to “!state…”
    • In 17.2.0, the hidden="" attribute is added to the object.

    Does anyone have any ideas about what’s going on and how to get the inline embeds back?

    # 17.1.4
    <div data-wp-interactive="" class="wp-block-file">
        <object data-wp-bind--hidden="!selectors.core.file.hasPdfPreview" class="wp-block-file__embed" data="https://www.example.com/wp-content/uploads/2023/12/my_file.pdf" type="application/pdf" style="width:100%;height:600px" aria-label="Embed of my_file."></object>
        <a id="wp-block-file--media-6d5841f4-a9c6-4340-9845-ef12c8b1d5a0" >my_file</a
        <a  class="wp-block-file__button wp-element-button" download="" aria-describedby="wp-block-file--media-6d5841f4-a9c6-4340-9845-ef12c8b1d5a0">Download</a>
        </div>
        
    # 17.2.0
    <div data-wp-interactive="{&quot;namespace&quot;:&quot;core/file&quot;}" class="wp-block-file">
        <object data-wp-bind--hidden="!state.hasPdfPreview" hidden="" class="wp-block-file__embed" data="https://www.example.com/wp-content/uploads/2023/12/my_file.pdf" type="application/pdf" style="width:100%;height:600px" aria-label="Embed of my_file."></object>
        <a id="wp-block-file--media-6d5841f4-a9c6-4340-9845-ef12c8b1d5a0" >my_file</a
        <a  class="wp-block-file__button wp-element-button" download="" aria-describedby="wp-block-file--media-6d5841f4-a9c6-4340-9845-ef12c8b1d5a0">Download</a>
        </div>
    • This topic was modified 11 months, 1 week ago by ccsmithwp.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Felipe Santos

    (@foosantos)

    Hi there,

    I wonder if you’re using a classic theme? If so, I believe it is related to this issue here: https://github.com/WordPress/gutenberg/issues/57370

    A for this specific issue will be added to 17.4.

    Thread Starter ccsmithwp

    (@ccsmithwp)

    Yes, I am, indeed, using a classic theme.

    I look forward to the fix; in the meantime, I’m getting by just fine with 17.1.4.

    I’m also looking into a possible theme change..

    Thanks for the reply!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PDF inline embeds hidden since 17.2.0’ is closed to new replies.