#25537 closed defect (bug) (fixed)
get_post_gallery() adds duplicate <br to the end, resulting in extra blank space
Reported by: | sgr33n | Owned by: | drozdz |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Gallery | Keywords: | good-first-bug has-patch commit |
Focuses: | Cc: |
Description
Using get_post_gallery() adds duplicate <br to the end, resulting in extra blank space.
Attachments (3)
Change History (15)
#1
@
11 years ago
- Component changed from General to Gallery
- Milestone changed from Awaiting Review to 3.9
#2
@
11 years ago
I tried to reproduce this issue and am able to reproduce it only if the last row of the gallery is full.
I first created a gallery of 5 images, 3 wide and tested by creating a gallery in a post and outputting it with the gallery shortcode and doing echo get_post_gallery( 1704 );
in debug. In both cases I got just one <br style="clear: both;">
at the end of each row. I then added a sixth image to the gallery and got the additional <br style="clear: both;">
that @sgr33n reports.
For reference, I am attaching an html file of the results of my 4 tests.
I am testing using 3.9-alpha pulled from trunk at ~2100UTC today (January 19 2014.)
@
11 years ago
Results of tests described in comment #2 showing when the issue happens and doesn't happen.
#5
@
11 years ago
- Owner set to drozdz
- Status changed from new to assigned
Looks good drozdz, thanks!
This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.
11 years ago
#10
@
11 years ago
Not sure if this is the right place to comment, but I'd love to +1 the option of ditching the <br style='clear:both;' /> tags altogether.
Resulting code