Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image: Fix duotone not being applied to lightbox image #54670

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ function render_block_core_image( $attributes, $content, $block ) {
}

if ( $lightbox_enabled ) {
return block_core_image_render_lightbox( $processor->get_updated_html(), $block->parsed_block );
// This render needs to happen in a filter with priority 15 to ensure that it
// runs after the duotone filter and that duotone styles are applied to the image
// in the lightbox. We also need to ensure that the lightbox works with any plugins
// that might use filters as well. We can consider removing this in the future if the
// way the blocks are rendered changes, or if a new kind of filter is introduced.
add_filter( 'render_block_core/image', 'block_core_image_render_lightbox', 15, 2 );
}

return $processor->get_updated_html();
Expand Down
Loading