WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

#14186 closed defect (bug) (duplicate)

gallery_style filter taking more code than just style

Reported by: wjm Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Media Keywords: has-patch
Focuses: Cc:

Description (last modified by nacin)

gallery_style hook takes more than just the style tag.

	$output = apply_filters('gallery_style', "
		<style type='text/css'>
			#{$selector} {
				margin: auto;
			}
			#{$selector} .gallery-item {
				float: {$float};
				margin-top: 10px;
				text-align: center;
				width: {$itemwidth}%;			}
			#{$selector} img {
				border: 2px solid #cfcfcf;
			}
			#{$selector} .gallery-caption {
				margin-left: 0;
			}
		</style>
		<!-- see gallery_shortcode() in wp-includes/media.php -->
		<div id='$selector' class='gallery galleryid-{$id}'>");

patched attached.

Attachments (2)

gallery_style_hook.patch (573 bytes) - added by wjm 4 years ago.
it only leave <style>..</style> in the filter,
gallery_style_hook2.patch (561 bytes) - added by wjm 4 years ago.
improved filter

Download all attachments as: .zip

Change History (4)

wjm4 years ago

it only leave <style>..</style> in the filter,

wjm4 years ago

improved filter

comment:1 wjm4 years ago

  • Keywords has-patch added

comment:2 nacin3 years ago

  • Description modified (diff)
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Going to close as a duplicate of #15103 as it has a better patch. Feel free to weigh in.

Note: See TracTickets for help on using tickets.