#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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.9 |
| Component: | Gallery | Version: | |
| Severity: | normal | Keywords: | good-first-bug has-patch commit |
| Cc: | Focuses: |
Description
Using get_post_gallery() adds duplicate <br to the end, resulting in extra blank space.
Attachments (3)
Change History (15)
#2
@
13 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.)
@
13 years ago
Results of tests described in comment #2 showing when the issue happens and doesn't happen.
This ticket was mentioned in IRC in #wordpress-dev by nacin. View the logs.
13 years ago
#10
@
13 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