WordPress.org

Support

Support » Plugins and Hacks » Exclude link with rel attribute "external" from parsing

Exclude link with rel attribute "external" from parsing

  • I want to sharing with you a problem that I’ve encountered on one of my website customer.

    there was an external link that begin like:

    http://www.example.com/ecommerce/….

    where the website of customer is like:

    Customer Communications Group

    Transposh rewrite url in this mode:

    http://www.customer.com/ommerce/

    so trunk the first 2 letters of first argument.

    So, I think I’ve found a solution. In row 766 of file parser.php, there’s a foreach loop to rewrite url for all “a” tags. I’ve add the rel=”external” control to exclude it from translation.

    So you can edit in this mode:

    foreach ($this->atags as $e) {
    if ($e->href && strcasecmp($e->rel, “external”) != 0)
    $e->href = call_user_func_array($this->url_rewrite_func, array($e->href));
    }

    I’ve add the “strcasecmp” function to control the content of rel attribute of link. And this works fine!

    I wish this can help someone like me.

    http://wordpress.org/extend/plugins/transposh-translation-filter-for-wordpress/

  • The topic ‘Exclude link with rel attribute "external" from parsing’ is closed to new replies.