Skip to content

WP file block with PDF data attribute url not replaced #800

@KoenLippe

Description

@KoenLippe

Steps to reproduce
// wp-config.php
define('WP_STATELESS_MEDIA_ROOT_DIR', "/uploads");
define('WP_STATELESS_MEDIA_CUSTOM_DOMAIN', "https://example.com");

  • Create a post and include a file block
  • Upload/select & PDF file to be displayed
  • View post

Result
This results in the following HTML block displaying the PDF preview (WP code)

<div 
    data-wp-interactive="core/file"
    class="wp-block-file"
>
    <object data-wp-bind--hidden="!state.hasPdfPreview"
            class="wp-block-file__embed"
            data="https://storage.googleapis.com/redacted-project/uploads/72629795-pdf-test.pdf"
            type="application/pdf"
            style="width:100%;height:580px">
    </object>
    .....
</div>

Expected

Additional information
By looking at the source code it looks like only src and href are replaced data remains untouched.

https://github.com/udx/wp-stateless/blob/latest/lib/classes/class-bootstrap.php#L1064

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions