WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#8839 closed enhancement (duplicate)

Filter to alter wp_get_attachment_image()

Reported by: dnusim Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.7
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

I would like to alter the HTML generated by wp_get_attachment_image() in wp-includes/media.php with a plugin.

Would appreciate it if a filter could be added.

Change History (4)

comment:1 @FFEMTcJ6 years ago

  • Keywords needs-patch added
  • Milestone changed from 2.8 to Future Release

comment:2 @Denis-de-Bernardy6 years ago

  • Component changed from General to Media
  • Owner anonymous deleted

comment:3 @Denis-de-Bernardy6 years ago

  • Milestone changed from Future Release to 2.9

comment:4 @Sam_a6 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

You can use the filter hook wp_get_attachment_image_attributes (added in 2.8 from ticket #8732) to change any of the <img/> attributes output from wp_get_attachment_image().

Note: See TracTickets for help on using tickets.