Saltar navegación

[Resuelto] during edit customer's url is appended with my url/the post name

This support ticket is created 3 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Rich 3 years, 2 months ago.

Asistido por: Minesh.

Autor
Mensajes
#2573845

I am trying to:
change data in a url field
Link to a page where the issue can be seen:
enlace oculto
I expected the link to the customer's website to be:
enlace oculto
Instead, the link is:
enlace oculto

The link worked correctly when I added the customers originally.
This also happened with another customer I tried to correct because I misspelled their domain:
enlace oculto
Thank you

#2574167

Minesh
Colaborador

Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You see the output as for your website link field: enlace oculto

Its because the website link is not started with http:// or https:// protocol.

To solve that I've added the following custom code to "Custom Code" section offered by Toolset:
=> enlace oculto

function func_check_http_for_url($attr,$content) {
  
    ///checking http:// protocol is available or not website
    if(strpos($attr['field'], '<em><u>enlace oculto</u></em>') !== 0) {
        return '<em><u>enlace oculto</u></em>';
    } 
    return '<a href="'.$attr['field'].'" target="_blank">'.$attr['field'].'</a>';
         
}
add_shortcode( 'check_http', 'func_check_http_for_url');

And called the above shortcode as given under from your content template:
=> enlace oculto
[php]
[check_http field="[types field='website' output='raw'][/types]"]
</coce>

More info:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/#adding-custom-php-code-using-toolset

You can replicate the above changes and shortocde wherever required with any of your site.

#2574573

My issue is resolved now. Thank you!