WordPress.org

Ready to get started?Download WordPress

Forums

WP 2.9 image insertion no longer allows url to off site resource (46 posts)

  1. workingroup
    Member
    Posted 4 years ago #

    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

  2. doc4
    Member
    Posted 4 years ago #

    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?

  3. Michael Bishop

    Posted 4 years ago #

    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.

  4. workingroup
    Member
    Posted 4 years ago #

    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.

  5. workingroup
    Member
    Posted 4 years ago #

    I upload from my pc...it happens every time...

  6. workingroup
    Member
    Posted 4 years ago #

    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>

  7. Michael Bishop

    Posted 4 years ago #

    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?

  8. workingroup
    Member
    Posted 4 years ago #

    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?

  9. Michael Bishop

    Posted 4 years ago #

    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.

  10. workingroup
    Member
    Posted 4 years ago #

    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...

  11. Gavin Wray
    Member
    Posted 4 years ago #

    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.

  12. jonnymoon
    Member
    Posted 4 years ago #

    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

  13. Gavin Wray
    Member
    Posted 4 years ago #

    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.

  14. darthead
    Member
    Posted 4 years ago #

    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.

  15. broofa
    Member
    Posted 4 years ago #

    === 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.

  16. broofa
    Member
    Posted 4 years ago #

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

  17. Arlo
    Member
    Posted 4 years ago #

    Not fixed for me, WP 2.9.2. "Save Changes" from Media didn't work. This is beyond frustrating, because I need the PERMANENT links set, not just in the post content.

  18. grandp
    Member
    Posted 4 years ago #

    If you are making a gallery of images and go to the HTML editor you can not see the code to edit it so you can not fit it.

  19. circuitor
    Member
    Posted 4 years ago #

    Just to chime in. We are having the exact same problem with 2 different installations of WP 2.9.2.

    Especially frustrating because as grandp notes, the workaround is not possible for images in a gallery (since there is no HTML for the gallery section when using the HTML editor).

    Any other ideas?
    (Also, is there any way to know if the bug report has been picked up?)

  20. Jay August
    Member
    Posted 4 years ago #

    This would be a good solution if one would actually add the image to the post, but in my case, I don't do that.

    I've programmatically added the attached images of the post/page you're viewing to a slideshow in the header of my template, by using this code:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
          <?php
    			$args = array(
    				'post_type' => 'attachment',
    				'numberposts' => -1,
    				'post_status' => null,
    				'post_parent' => $post->ID
    				);
    			$attachments = get_posts($args);
    			if ($attachments) {
    				foreach ($attachments as $attachment) {
    					echo "<div class=\"slide_item\">";
    					echo apply_filters('the_title', false);
    					the_attachment_link($attachment->ID, true);
    					echo "</div>";
    					echo "";
    				}
    			} else {
    			?>
            <a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('template_url'); ?>/images/defaultimage.jpg" alt="" title="" /></a>
    <?php } ?>
    
            <?php endwhile; else: ?>
    <!-- no images found //-->
    			<?php endif; ?>

    The -quite excellent- trick with this is that the webmaster can just upload a couple of images to the post/page, hit 'save changes' and the code does the rest...

    but, when viewing the slideshow in my browser, the manually added link is not saved. I also noticed this link is not stored in the database, which is quite a PITA since I really need that feature.

    Would there be any workaround for this? It would save my day :) Thnx for any assistance!

  21. audi22
    Member
    Posted 4 years ago #

    I am on 2.9.2 on every site I manage and the bug still exists as described by @gavinwray.

  22. Rashunda
    Member
    Posted 4 years ago #

    I'm having the same issue as well. Running WPMU 2.9.1.

  23. rogermh
    Member
    Posted 4 years ago #

    Same issue here on 2.9.2.

  24. rogermh
    Member
    Posted 4 years ago #

    Looks like this issue has been fixed: http://core.trac.wordpress.org/ticket/12315

    I haven't been able to confirm it though.

  25. Rashunda
    Member
    Posted 4 years ago #

    Not really sure what the fix is suggesting. Is it saying not to add rel="attachment" ? In my case, no one has done that anyway.

  26. VSHoward
    Member
    Posted 4 years ago #

    It's not fixed because I'm having the same frustrating issue with 2.9.2.

    In my case the the gallery HTML is only short code: [gallery orderby="rand"]. I need to be able to update the Link URL to a video hosted on Vimeo and it won't take no matter what I try. It just keeps reverting back to the default URL. Has anyone found a fix to this yet?

  27. rogermh
    Member
    Posted 4 years ago #

    VSHoward, it's not fixed in 2.9.2, but my understanding is that it is fixed in the nightly. I suggest you try downloading and installing that.

  28. VSHoward
    Member
    Posted 4 years ago #

    Thanks Rogermh,

    I downloaded and did a comparison using WinMerge on all the files & folders in wp-admin & wp-includes with the copy I'm using and nothing flagged as being different which leads me to believe it has not been fixed.

  29. VSHoward
    Member
    Posted 4 years ago #

    Does anyone have a fix for this?

  30. nannaw
    Member
    Posted 4 years ago #

    I am also waiting for a solution. Have the latest version but still will not allow me to insert a link to another website in an image!

Topic Closed

This topic has been closed to new replies.

About this Topic