WordPress.org

Support

Support » How-To and Troubleshooting » WP 2.9 image insertion no longer allows url to off site resource

WP 2.9 image insertion no longer allows url to off site resource

  • I noticed a glaring problem with WP 2.9…in 2.8.6 you could upload an image and link it to an off site resource.

    Now when you upload an image it puts the url of the image in the link box (to where it is on your own site) and when you attempt to replace that with any other link, say, to the source of the image offsite) it erases it and puts the original.

    I think there are probably 10,000’s of WP users who want to use images as portals to other sites…WP 2.9 does not seem to do that. I only got around it by using the URL link on the entire image, outside of the image import/edit function

Viewing 15 replies - 1 through 15 (of 45 total)
  • workingroup,

    Are you referring to placement of an uploaded image within the post editor? If this is the case then this is correct behavior. Can ou please explain this further?

    I don’t see that behavior. I uploaded an image, changed the URL, and the resulting code was correct. <a href="the_link_I_added"><img src="the_path_to_the_image" blah blah></a>

    Did you use the option to upload “from computer” or “from URL”. using “from URL” you can provide the path to the image, then below Alignment, provide an address that the image links to.

    OK. please understand I am no expert.

    When using the What you se what you get editor for writing a post, I press the insert image button and upload an image.

    There then appears an image insertion dialogue box and this contains various settings, one of which is the link for the image.

    In 2.8.6, you could put an offsite link in that line-box. Now there automatically appearas a link to the image attatchment.

    I looked everywhere for a line where I could put an offsite link, and tried to replace the link attachment since that box is where the offsite link went before hand.

    But when I do the image insert and then press update the post, the old image attachment local url replaces my edit. And the image when clicked by my readers leads to the image on my site, not to the off site source.

    I upload from my pc…it happens every time…

    The automatic link which appears is in this format:

    http://www.domainname.com/?attachment_id=####

    The code insertion created by an image insert resulting thus:

    <a rel="attachment wp-att-°°°°" href="http://www.domainname.com/?attachment_id=####"><img class="aligncenter size-full wp-image-####" title="name of file" src="http://www.domainname.com/wp-content/uploads/2009/12/nameoffile.gif" alt="" width="XXX" height="YYY" /></a>

    I see now that it won’t save the changed link, even if I click save changes, however, if I change the link URL, then click “Insert into Post”, it will correctly insert the link. Are you using the gallery feature at all?

    No, I am not using the gallery feature to display images in my posts.

    When you say,

    “however, if I change the link URL, then click “Insert into Post”, it will correctly insert the link. Are you using the gallery feature at all? “

    do you mean I have to go to the Media Library and change the URL there?

    When you click the first icon next to “upload/insert” to add an image, select the image to upload from your computer, there’s a field for “Link URL” below Description, above Alignment.

    Change that URL to what ever address you want the image to link to, then click the “Insert into Post” button below the Size option. This should insert the image into the post linking it to the external site.

    You can confirm this by looking at the HTML view.

    Mikb,

    Some plugin update came through during the night, and now I don’t have the problem any more…

    What caused it, is a mystery, but thankfully it is resolved…

    I’ve been having this same issue with the “Add an image” popup in the Media Library in WP 2.9. Here’s the case where specifying your own Link URL works ok:

    1) Insert image > Upload from computer
    2) Manually add a URL in the “Link URL” field
    3) Choose “Insert into post”
    4) The URL is added correctly.

    Here are the steps where specifying your own Link URL in the Media Library fails:

    1) Insert image > Media Libary tab
    2) Click “Show” next to an existing image
    3) Manually add a URL in the “Link URL” field
    4) Don’t click “Insert into post”. Instead, choose “Save all changes” at the bottom of the “Add an image” popup.
    5) Click “Show” next to the image you edited in steps 2 and 3.
    6) The URL in “Link URL” field hasn’t been saved. The URL has reverted to http://mydomain.com/wp-content/uploads/imagefilename.jpg

    I’ve noticed that since upgrading to WP 2.9, the Link URLs for all files in my Media Library have reverted to http://mydomain.com/wp-content/uploads/imagefilename.jpg. Fortunately, these changed links haven’t carried through to the front-end.

    User lionc provided a solution that worked for me in this thread:

    http://wordpress.org/support/topic/343943

    That solution:

    go to Settings->Media and click Save Change

    Looks like this problem was solved in WP 2.9.1.

    Specifying any URL (external and internal) is working fine for me since I upgraded.

    I am still having the same issue that @gavinwray described:

    Here are the steps where specifying your own Link URL in the Media Library fails:

    1) Insert image > Media Libary tab
    2) Click “Show” next to an existing image
    3) Manually add a URL in the “Link URL” field
    4) Don’t click “Insert into post”. Instead, choose “Save all changes” at the bottom of the “Add an image” popup.
    5) Click “Show” next to the image you edited in steps 2 and 3.
    6) The URL in “Link URL” field hasn’t been saved. The URL has reverted to http://mydomain.com/wp-content/uploads/imagefilename.jpg

    I’m using 2.9.1 and have tried the solution mentioned by @jonnymoon with no success.

    === WORKAROUND ===

    THE PROBLEM (as I experienced it):
    After inserting an image into a post, changing the “Link URL” has no effect. When previewing the post, the image link will appear to point to whatever URL you specify, but “Update”ing the post has no effect.

    THE SOLUTION
    The “problem” occurs when the link has a “rel” attribute on it that refers to the uploaded image. You can see this in the HTML source by finding the link tag and looking for something like this:

    <a href="..." rel="attachment wp-att-1909">...

    It’s that ‘rel=”…”‘ attribute that’s causing the problems. WP sees that and rewrites the href to point to whatever attachment that refers to.

    To fix this, simply use the “HTML” tab in the editor to edit the source and remove that ‘rel’ attribute.

    For anyone who’s interested, I’ve filed a bug about this issue here: http://core.trac.wordpress.org/ticket/12315#comment:1

Viewing 15 replies - 1 through 15 (of 45 total)
  • The topic ‘WP 2.9 image insertion no longer allows url to off site resource’ is closed to new replies.