[wp-trac] [WordPress Trac] #59138: Duotone filter selector does not apply when using Image block alignment

WordPress Trac noreply at wordpress.org
Sat Aug 19 05:42:45 UTC 2023


#59138: Duotone filter selector does not apply when using Image block alignment
------------------------------+---------------------
 Reporter:  nidhidhandhukiya  |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  6.3.1
Component:  Editor            |     Version:  6.3
 Severity:  normal            |  Resolution:
 Keywords:  has-patch         |     Focuses:
------------------------------+---------------------

Comment (by bijit027):

 This issue occurred when we saved the post with alignment. The post data
 was saved with a class name like this: <figure class="wp-block-image
 align-right size-full is-resized is-style-rounded">. However, when viewing
 the post on the user side, it mistakenly changed the class of the figure
 tag to <figure class="align-right size-full is-resized is-style-rounded">,
 omitting the 'wp-block-image' class. As a result, this part of the CSS:


 {{{
 .wp-duotone-cf2e2e-abb8c3-1.wp-block-image img,
 .wp-duotone-cf2e2e-abb8c3-1.wp-block-image .components-placeholder {
   filter: url(#wp-duotone-cf2e2e-abb8c3-1);
 }

 }}}
 was not applied to this <figure> tag.

 When the post content is filtered in layout.php, it removes 'wp-block-
 image' at line 856 due to this code:
 {{{
 $filtered_content_classnames = array_diff( $content_classnames,
 $wrapper_classnames );
 }}}

 I have made a code change to:
 {{{
 $filtered_content_classnames = array_diff( $content_classnames, array(
 $block['attrs']['className'] ) );
 }}}


 [[Image(https://prnt.sc/opqImP0yiIRp)]]

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59138#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list