Custom field in jQuery

Hi,

I would like to know if it´s possible to add shortcodes in this code so I can use ACF Pro to add the links using custom fields when editing the page outside of Pro/Cornerstone?

jQuery("#box1").wrap(“link1”);

jQuery("#box2").wrap(“link2”);

jQuery("#box3").wrap(“link3”);

Best regards
Melker

Hi there,

Thanks for writing in.

It’s not possible, they are javascript that runs on a browser. Shortcodes are PHP that runs on the server. You will need an extended customization that will echo the PHP output to javascript variable before it can be processed by your javascript code. I recommend contacting a developer.

And please note that if your shortcode contains sensitive information then it will become public once converted to javascript variables.

Thanks!

Ok I understand that.

Would it be possible to access the information (the links) in the custom fields any other way?

Read your post a bit more careful and see what have to be done.

Glad we could point you to the right direction.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.