Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've written a filter to wrap images included in posts with figure tags and their captions with figcaption tags. I turned off the visual editor so that it doesn't strip out all the html from the images.

That all seems to work fine until I publish or update the post. At this point the link to the full size image gets changed to /sitename/post-type/post-title/attachment/attachment-title/ where before it was /sitename/assets/filename.jpg

Can anyone help suggest why this is happening?

Here is a link to the filter code on pastebin

share|improve this question
    
The problem was down to my use of rel="attachment" in the anchor, with this removed the editor allows the link to remain pointing to the file url and not the attachment. –  Tim Manners Jan 16 '12 at 12:53
    
Please add your solution as an answer so it is more in line with site mechanics and your question doesn't haunt site as unanswered. –  Rarst Jan 16 '12 at 13:12

1 Answer 1

The problem was down to my use of rel="attachment" in the anchor, with this removed the editor allows the link to remain pointing to the file url and not the attachment.

share|improve this answer
    
Please mark your question as answered. –  toscho Feb 28 '12 at 20:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.