WordPress.org

Ready to get started?Download WordPress

Forums

Modification to wp_get_attachment_url (4 posts)

  1. spyke01
    Member
    Posted 3 years ago #

    Guys,
    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
    Member
    Posted 3 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
    Member
    Posted 3 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
    Member
    Posted 3 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

Tags

No tags yet.