Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#6354 closed defect (bug) (worksforme)

New media/attachment template tags need some love

Reported by: westi's profile westi Owned by: westi's profile westi
Milestone: Priority: high
Severity: blocker Version: 2.5
Component: Template Keywords:
Focuses: Cc:

Description (last modified by westi)

As photomatt said on IRC some of the new template tags for media/attachments don't have the standard configurablty or sensible names that our other template tags have.

This is a blocker for 2.5

< photomatt_hou> like wp_get_attachment_link, which doesn't return a link
< photomatt_hou> previous_image_link which doesn't support anything the other next/prev functions do

Change History (6)

#1 @westi
17 years ago

  • Description modified (diff)

#2 @ComputerGuru
17 years ago

Silly question, but I'll ask anyway.. How is

return "<a href='$url' title='$post_title'>$link_text</a>";

not a link?

#3 @ryan
17 years ago

Most of our get_link functions return just a url. Maybe that is what is meant.

#4 @westi
17 years ago

Indeed most get_*_link functions return just a url.

Also at present wp_get_attachment_link returns a link with either text or image content depending on whether or not the linked attachment is an image with no configurability

#5 @andy
17 years ago

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

The function names are terrible but not all new with 2.5:

wp_get_attachment_url returns the file URL

get_attachment_link returns the attachment permalink URL

wp_get_attachment_link returns an A tag with the option to use the file URL or the permalink.

If you want a text link to an image, use get_attachment_link.

#6 @lloydbudd
17 years ago

  • Milestone 2.5 deleted
Note: See TracTickets for help on using tickets.