Make WordPress Core

Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#15180 closed enhancement (fixed)

Float Issue on Admin Widgets Page

Reported by: InterTrade Owned by: markjaquith
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.0.1
Component: Widgets Keywords: has-patch
Focuses: Cc:


When adding custom widgets with multiple line descriptions to the , the widgets listed in the administration area of Wordpress, the repeated floats on each of the widget controls can cause the display leave a blank space where a widget control should be.

My recommendation is to place a clear float after every other widget.

For example, I resolved my issue by adding the following code to line 53 of the wp-admin/includes/widgets.php file:

<?php if ((round($counter / 2, 0) * 2) == $counter) {

echo "<br style='clear: both; height: 0; font-size: 1px; line-height: 0px;' />";

} ?>

Attachments (5)

15180-fix-crossbrowser.diff (403 bytes) - added by mattdanner 7 years ago.
15180-fix-nohack.diff (383 bytes) - added by mattdanner 7 years ago.
15180-fix-fresh.diff (399 bytes) - added by mattdanner 6 years ago.
Fresh patch for ticket 15180
15180.png (41.9 KB) - added by SergeyBiryukov 6 years ago.
15180.after.png (40.5 KB) - added by SergeyBiryukov 6 years ago.

Download all attachments as: .zip

Change History (11)

#1 @Denis-de-Bernardy
8 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Type changed from defect (bug) to enhancement

That code prevents widgets to be well organized if the screen is large enough to accommodate 3 widgets per column.

I suspect that what's needed, rather, is something JS/CSS-driven that dynamically adds a clear attribute using nth-child statements.

Seems extremely low priority however. Punting to future pending further discussion and a more proper patch.

#2 @mattdanner
7 years ago

  • Cc mattdanner added
  • Keywords has-patch added
  • Severity changed from trivial to normal

I have created a patch that uses inline-block (rather than float: left) to fix the alignment issue. This eliminates the need to do code modification as suggested by the creator of the ticket.

I have provided two patches. 15180-fix-crossbrowser.diff fixes the alignment in all browsers (including IE6/7), but uses a selector hack to achieve this. 15180-fix-nohack.diff fixes the alignment issue in Firefox, Chrome, Safari, Opera, and IE8, but doesn't fix IE6/7.

#3 @markjaquith
6 years ago

  • Milestone changed from Future Release to 3.5

Patch works.

#4 @markjaquith
6 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In [21547]:

Fix the display of widgets in wp-admin when their descriptions wrap to two lines. props mattdanner. fixes #15180

6 years ago

Fresh patch for ticket 15180

6 years ago

#5 @SergeyBiryukov
6 years ago

  • Keywords widgets dashboard admin float removed

To be clear, added the screenshots before and after the patch.

#6 @SergeyBiryukov
6 years ago

#20939 was marked as a duplicate.

Note: See TracTickets for help on using tickets.