Can a custom shortcode be used in ACF format?

Can a custom shortcode be used in ACF format?

Don’t know a lot about custom shortcodes, but I tested this and it worked. You can also add an acf/format_value filter, this exact example is covered here https://www.advancedcustomfields.com/resources/acf-format_value/

How to create a shortcode using advanced custom fields?

To do this you must first install and activate the ACF plugin on your WordPress website. You can download the free version here. Create a field group with the information you want to use. You can learn more about how to do this on the ACF website. Once you have your field set up you can start creating your shortcode.

Can you add an ACF / format _ value filter?

You can also add an acf/format_value filter, this exact example is covered here https://www.advancedcustomfields.com/resources/acf-format_value/ Thanks for all the comments, I solved it by adding the following to my functions.php

When to use shortcodes in the text field?

While you can do it in the code when you get the field using the filter allows you to do it once instead of at every instance where the field is used. It also allows you to easily alter the field long after the fact so that you don’t need to find every location where it is used in your theme and alter the code in every location.

Can a shortcode be added to a text field?

If the person that is doing the editing has access to the content editor and therefore are able to add shortcodes to the content then there is no extra security risk by allowing them to put shortcodes into text and textarea fields. Simple as this code. No add code @ function.php

Can a custom field be called inside a block?

I was calling my custom field which wasn’t registered inside the block, instead it was registered outside the block in the side of the page and this can’t be called inside the block it seems. You must be logged in to reply to this topic.