[wp-trac] [WordPress Trac] #53801: Block-based Widgets Screen does action wp_footer after each Widget

WordPress Trac noreply at wordpress.org
Sat Aug 28 04:14:45 UTC 2021


#53801: Block-based Widgets Screen does action wp_footer after each Widget
--------------------------+---------------------
 Reporter:  MadtownLems   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  5.8.1
Component:  Widgets       |     Version:  5.8
 Severity:  major         |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by costdev):

 Replying to [comment:21 zieladam]:
 > Using wp_head and wp_footer in the preview may indeed add some
 unexpected content there. At the same time, not having the preview seems
 like a broken experience. Either of these seems imperfect and I don't
 think there is a solution that could make things 100% right.
 >
 > My two cents are that we probably can't solve all the cases here, but we
 likely can solve most of them. To get more practical: We want to hide any
 extra content a) rendered by PHP and b) added in the runtime by
 javascript. Assuming iframed preview, I wonder if this rule would already
 account for most cases: `body > *:not(.allowlisted_preview_div) { display:
 none !important; pointer-events: none !important; opacity: 0 !important; }
 `.
 >
 > Sure, it is possible to write a script that will overcome that. But how
 often does that actually happen?

 In the interests of furthering this issue towards a workable resolution,
 I'm happy to submit patches that follow the solutions that are up for
 consideration. By applying the patches and experiencing the results within
 your own installs (non-production please!), we can get more well-rounded
 feedback.

 To that end, I'm about to add a patch with a CSS solution (similar concept
 to yours @zieladam, but it also handles loose text nodes). While still
 possible to overcome this solution, I believe you'd need to add content
 specifically to the `.widget` itself to do so. However, test, test, test.

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


More information about the wp-trac mailing list