WordPress.org

Ready to get started?Download WordPress

Forums

relative path in editor (7 posts)

  1. riquard
    Member
    Posted 5 years ago #

    Since wp 2.7, when copying a link from a post and pasting it in the TinyMCE editor, it changes the address from an absolute to a relative one.
    eg.
    href="http://website.com/child/page/" becomes
    href="../child/page/"

  2. riquard
    Member
    Posted 5 years ago #

    This problem is not caused by wordpress. It only occurs in firefox, It could be a plugin. I don't have a solution yet, but I am not the editor of our site, so I let it rest.

  3. riquard
    Member
    Posted 5 years ago #

    Any ideas on this? Now the our editor also has this problem..firefox or a plugin.. is 'helping' to change the absloute paths in links to relative links. It is starting to become a big problem now, because we use like 5 links in every post and they are not working anymore. Anyone else had this problem?

  4. billbennett
    Member
    Posted 4 years ago #

    Did you resolve this? I'm having a similar problem see http://wordpress.org/support/topic/311927

  5. riquard
    Member
    Posted 4 years ago #

    No I haven't. We work around it by first editting the post where we copy the links from. then it doesn't convert he path to a relative one.

    I will close this topic and when I have more info on this, I will use your topic.

  6. riquard
    Member
    Posted 4 years ago #

    Ok, I open this again, because billbennett has solved his problem, but his solution didnt solve my problem.

    I found out that the content is copied fine to the windows clipboard, but when you paste it in the wordpress editor, it is changed.

  7. riquard
    Member
    Posted 4 years ago #

    I have put this in functions.php. This doesn't solve the problem, because the postcontent is still misformed in the database, but the links now work on the site.

    function fix_relativepathproblem($the_content){
    return str_replace('href="../', 'href="http://oranjemuziek.nl/', $the_content);
    }
    add_filter('the_content', 'fix_relativepathproblem');

Topic Closed

This topic has been closed to new replies.

About this Topic