Gallery: Link to Media File selected, but link="file" missing from shortcode (9 posts)

  1. conualfy
    Posted 3 years ago #

    I haven't inserted galleries for a while, but just now, when I try to insert a new gallery, things work ok but not perfect.

    I select "Link to -> Media file", but the shortcode that appears in my editor looks like this:
    [gallery ids="7006,7007,7008,7009,7010,7015,7014,7013,7012,7011,7016,7017"]

    I use the text editor, but I could see it works the same on visual editor.

    If I switch to visual and try to edit the gallery, it does not detect the gallery type right, I get the autoselected "Link to" ->"Media File", but of course, there is no link="file" in the code and it does not work like that (it does not link the images to files).
    Switching (in visual editing) from default field to "Link to" -> "Attachment page" and back to "Media File" works, but those are extra steps I do not need to do.

    Please auto-initialize those variables, so it works from start without any extra steps.

  2. faeldray
    Posted 3 years ago #

    I've noticed the same issue. It seems that when you switch it to "Media File", it's not inserting the link="file" into the code.

  3. jackfuture
    Posted 3 years ago #

    Same issue here. Please fix this asap!

    I'd be also grateful for a workaround to avoid this annoying bug :)

  4. conualfy
    Posted 3 years ago #

    I found a workaround: before inserting the gallery, change the dropbox to Attachment and back to Media file. It will insert the link="file" in the shortcode.

    The bug is that it does not initialize the variable the script uses for this.

    BTW, do you also get a very slow reaction when inserting images? In my installation, it works very show to insert media files (I can count a few seconds between the moment I press Insert file and the code appears in my editor).

  5. glrss
    Posted 3 years ago #

    There's a ticket open for this: http://core.trac.wordpress.org/ticket/23298 so hopefully it will be fixed in 3.5.2

  6. nrepair
    Posted 3 years ago #

    Same problem here. The workaround that conuafly posted does work though. ;)

  7. Ciro Urdaneta
    Posted 3 years ago #

    It eels good not to be the only one with this issue :D
    I really need a fix

  8. Try the cleaner gallery plugin. In the settings you can select the image file as the link and it works.


    The other option is select "Attachement page" from the dropdown menu, then go back to 'Media file' This adds gallery link="file" to the shortcode.

  9. wattyrev
    Posted 2 years ago #

    Here is a fix that I found in another thread. This works well if you never use attachment pages. Everything just defaults to linking to the media file.

Topic Closed

This topic has been closed to new replies.

About this Topic