Make WordPress Core

Opened 11 years ago

Closed 10 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;
		<!-- 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 11 years ago.
it only leave <style>..</style> in the filter,
gallery_style_hook2.patch (561 bytes) - added by wjm 11 years ago.
improved filter

Download all attachments as: .zip

Change History (4)

11 years ago

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

11 years ago

improved filter

#1 @wjm
11 years ago

  • Keywords has-patch added

#2 @nacin
10 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.