The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Modification to wp_get_attachment_url (4 posts)

  1. spyke01
    Posted 5 years ago #

    I have a modification that I have made a tested to the wp_get_attachment_url function that will allow keep WP from prefixing and FULL URL with the WP install's url.

    ex. http://mysite.com/image.png instead of http://mywpsite.com/wp-content/uploads/http://mysite.com/image.png

    My question is how can I make the change a permanent feature of the theme I am using so that the change isn't removed in updates to WP?

  2. MandyWhite
    Posted 5 years ago #

    If I were you, I would just create an alias on the server using either apache config or your htaccess file to map or redirect the path to a different physical directory. Do you have access to either?

    WordPress tacks another full domain name w/http:// onto your upload folder? That's really strange. I imagine some browsers and search engines wouldn't like that structure, at all.

  3. spyke01
    Posted 5 years ago #

    Well its a custom attachment insert that uses a full URL so we don't have to upload gigs of images but WP still thinks they are on the server since its a post attachment.

  4. spyke01
    Posted 5 years ago #

    A better way to ask this is how do I replace the hook for wp_get_attachment_url with one of my own?

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.