Passer la navigation

[Résolu] button link with custom field as a parameter doen't works

This support ticket is created Il y a 3 years, 8 months. 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 -

Fuseau horaire du supporter : Asia/Kolkata (GMT+05:30)

Ce sujet contient 1 reply, a 2 voix.

Dernière mise à jour par Minesh Il y a 3 years, 8 months.

Assisté par: Minesh.

Auteur
Publications
#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":
lien caché 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 lien caché

Thanks,
David

#2473379

Minesh
Supporter

Les langues: Anglais (English )

Fuseau horaire: 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>lien caché</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/