Hi,
Title will just set the tilte=”” attribute, not the link text between the anchor tags so it will set <a title=”THIS”>NOT THIS</a>
Sorry @talextech, but I don’t get how this works.
The help text in the backend says :
Use this <code>{title}</code> for the original title value and <code>{text}</code> for the link text (or <code>{text_clean}</code> for text stripped of HTML) as shown on the page
So if I have this example link :
<a href="#"><em>hello</em></a>
When I use the set title feature with {text clean}, I would expect the title to be the link text stripped of HTML tags. Like this :
<a href="#" title="hello"><em>hello</em></a>
Instead, I got something like this, where the HTML tags aren’t stripped :
<a href="#" title="<em>hello</em>"><em>hello</em></a>
The <em> tag should not make it into the title, even as <em> as I specifically used {text_clean}
Am I missing something ?
Sorry, you are right! We have added some extra sanitization a while back and we escaped that instead of stripping the tags 🙁
We will push an update to fix it ASAP but in the meantime if you are comfortable editing code you can edit wp-external-links/includes/class-wpel-front.php line 298 and replace:
$new_title = str_replace( array( '{title}', '{text}', '{text_clean}' ), array( esc_attr( $title ), esc_attr( $text ), esc_attr( $text ) ), $title_format );
with
$new_title = str_replace( array( '{title}', '{text}', '{text_clean}' ), array( wp_strip_all_tags( $title ), wp_strip_all_tags( $text ), wp_strip_all_tags( $text ) ), $title_format );