Home Forums Front-end Issues Shortcodes in text field Reply To: Shortcodes in text field

  • Just because the documentation applies it to all textarea fields does not mean you must. Format value can also be used on just specific fields by including the field name or the field key in the filter name. You must remember that the examples are just that, examples, using the most simple form of the filter to get the point across.

    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.

    Here’s my take on security in this case. 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.