Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11167 closed enhancement (fixed)

Pass $size and $attr to post_image_html filter

Reported by: waltervos's profile waltervos Owned by: markjaquith's profile MarkJaquith
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Media Keywords: has-patch needs-testing the_post_image filter
Focuses: Cc:

Description

It seems strange to me that get_the_post_image accepts $post_id, $size and $attr but when the filter post_image_html is applied, these parameters are not passed to it. This way, when $html is empty (when an image wasn't found) a plugin author only has $post_id to work with it. If you wanted to make a plugin that will use a default image where no post_image was found, you couldn't. A patch is attached to this ticket to illustrate what I mean.

Attachments (2)

get_the_post_image-enhancement.txt (953 bytes) - added by waltervos 15 years ago.
get_the_post_image-enhancement.diff (445 bytes) - added by scribu 15 years ago.
diff format

Download all attachments as: .zip

Change History (4)

@scribu
15 years ago

diff format

#1 @ryan
15 years ago

  • Owner set to MarkJaquith
  • Status changed from new to assigned

#2 @markjaquith
15 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [12211]) Pass some additional variables to post_image_html filter. props waltervos, scribu. fixes #11167

Note: See TracTickets for help on using tickets.