Using the latest dev of Media on D7.25, I'm having a small issue when embedding images that are linked through the view mode.
I try to override theme_link to add a FID attribute to the links but this does not work unless I flush the cache manually. I can't seem to find any clues as to where in Media or media_wysiwyg the links get generated initially or if this is a cache issue.
On the site we have disabled all caching during development so it's kinda weird we have to flush the cache at all.
Now, question is, should I be overriding some other hook or should the theme_link override really be working here? I'm guessing this might be due to something with the media_token_to_markup function but that function doesn't seem to run when I expect it to run - i.e. on either node insert / update or node view.