Skip Navigation

[Resolved] Filter for modifying Toolset custom field output?

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 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 1 voice.

Last updated by shannonM-4 1 week ago.

Assisted by: Minesh.

Author
Posts
#2864992

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 "hidden link" 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

#2865000

Minesh
Supporter

Languages: English (English )

Timezone: 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 );
#2865009

Minesh,

Thanks for your reply.

This *almost* worked. It changed the display value *and* the target URL, creating a relative link:

<em><u>hidden link</u></em>

I only wanted to change the display value so the link will appear like so:

<em><u>hidden link</u></em>

(Yes, I could manually create the link by inserting the URL twice, but I'm wondering if there's another way.)

Saul

#2865027

Minesh
Supporter

Languages: English (English )

Timezone: 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.

#2865038

Sounds good. Thanks, Minesh!