Skip Navigation

[Resolved] button link with custom field as a parameter doen't works

This support ticket is created 2 years, 3 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 -

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

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 2 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2472551
toolset2.jpg
toolset1.jpg

PLEASE: I don't want show my URL plublicly

Tell us what you are trying to do?
button link with custom field as a parameter doen't works
Here you can see a button in the screenshot "toolset1.jpg"

the button link code is the code you can see in the screenshot "toolset2.jpg":
hidden link field="crm-id-presencial" output="raw"]

This code works fine as a text, but when I put it in a link the shortcode "[types field="crm-id-presencial" output="raw"]" returns nothing.

our development site is hidden link

Thanks,
David

#2473379

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I checked and I can see that what you see is expected as lets say parsing shortcode with attributes will be really challenging as there will be single/double quotes involved and that will make the structure more complex.

I see you are using the Gutenberg button block, Toolset also offers the Button block but again with Toolset button block as well the shortcode with attribute will not get parse.

The workaround would be, you should try to add a custom shortcode and that shortcode should return your desired value.

For example:

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

For example, you should add the custom shortcode as:

function func_get_crmid_presencial( $atts ) {
 
global $post;
 
return get_post_meta($post->ID,'wpcf-crm-id-presencial',true);

 
}
 
add_shortcode( 'get-crm-id-presencial', 'func_get_crmid_presencial' );

Where:
- You can adjust the shortcode code as required.

And add the shortcode to "Custom Code" section Offered by Toolset:
- https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/
-https://toolset.com/documentation/programmer-reference/adding-custom-code/