Hi there,
I checked the documentation and didn't see a PHP filter to modify the content of custom field output. I figured I'd ask a human being in case I missed it. Is there one?
For URLs, I want to strip the "enlace oculto " prefix. The Types Fields API supports a "no_protocol" attribute for URL fields (https://toolset.com/documentation/customizing-sites-using-php/functions/#url ), but this isn't supported in the block editor.
Thanks.
Saul
Minesh
Colaborador
Idiomas:
Inglés (English )
Zona horaria:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
What if you try to use the following filter:
For example - Can you please try to add the following code to your theme's functions.php file and check if that help you to resolve your issue.
add_filter( 'wpcf_fields_type_url_value_display','wpcf_fields_no_protocol_parser', 10, 4 );
Minesh,
Thanks for your reply.
This *almost* worked. It changed the display value *and* the target URL, creating a relative link:
<em><u>enlace oculto</u></em>
I only wanted to change the display value so the link will appear like so:
<em><u>enlace oculto</u></em>
(Yes, I could manually create the link by inserting the URL twice, but I'm wondering if there's another way.)
Saul
Minesh
Colaborador
Idiomas:
Inglés (English )
Zona horaria:
Asia/Kolkata (GMT+05:30)
I suggest for that you should use shortcode as using shortcode you can create such link. You can use the shortcode block and add the Types shortcode to it.
Sounds good. Thanks, Minesh!