Skip to content

File Block: Embed Permission Issue With unfiltered_html capability #72370

@MichaelCastelbuono

Description

@MichaelCastelbuono

Description

The issue boils down to roles without the unfiltered_html capability trying to embed PDFs from third-party websites. The PDF embed preview shows correctly in the gutenberg editor (initially), however when viewing the saved page it only shows the link to the PDF. The embed is missing. Additionally when refreshing the editor the block rendering the "invalid or unexpected content" error.

Image

Step-by-step reproduction instructions

  1. Install a plugin such as WP offload media or similar so that a PDF can be housed off-site. Alternatively reference an external PDF directly in the file block.
  2. Add a new user and assign them the author role. The author role does not have the unfiltered_html capability.
  3. Add a new post as the author.
  4. Add a file block and reference the external PDF.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.8.3

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] FileAffects the File Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions