Skip to content

Cover image cannot be added without unfiltered_html capability #2539

@SergeyBiryukov

Description

@SergeyBiryukov

When adding a Cover Image block to a post, the resulting <section> element is supposed to have a style attribute with a background image:

<section class="wp-block-cover-image has-background-dim" style="background-image:url(https://melchoycetestingpressable.mystagingwebsite.com/wp-content/uploads/2017/02/cropped-pexels-photo-297755.jpeg)">
<h2>This is a cover block</h2>
</section>

However, testing Gutenberg 0.9.0 as an admin user on a Multisite network, the style attribute is stripped, resulting in a section with no background image:

<section class="wp-block-cover-image has-background-dim">
<h2>This is a cover block</h2>
</section>

At a glance, it's because in Multisite regular admins don't have the unfiltered_html capability, only super admins do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrameworkIssues related to broader framework topics, especially as it relates to javascript[Priority] HighUsed to indicate top priority items that need quick attention[Type] BugAn existing feature does not function as intended[Type] WP Core TicketRequires an upstream change from WordPress. Core Trac ticket should be linked.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions