I am running a Wordpress site and using WPML translation plugin. In WPML there is a method called icl_link_to_element(2880);
that returns and generates the following element in the DOM:
<a href="https://www.someurl.com/es/atencion-al-cliente">Atención al cliente</a>
I want to convert this element to a string so that I can simply return and store the last part of the url atencion-al-cliente
, into a unique variable.
What's the best way to get this done?
Answer to the comment below:
Two elements appear in the DOM now.
<a href="https://www.someurl.com/es/atencion-al-cliente">Atención al cliente</a>
and
"NULL
"