Can I create a customizer setting which will handle a shortcode from a plugin? Do I violate and rules or guidelines in WordPress theme development?

If it's possible what is the best way to sanitize the shortcode data from my customizer setting?

  • Hi there, did you end up doing this? How did it go?
    – Tim Malone
    Jun 29 '16 at 7:54
  • What is your objectives. Needs more details. Feb 3 '17 at 19:02
  • You couldn't use short code within theme. But, In plugin you'll do it. What do you mean short code sanitization? If you provide the textarea control to add short code from customizer then you can use the do_shortcode. But, need more details to know what you want to achieve. Feb 3 '17 at 19:06

It's probably best to render the shortcode on output by running it through do_shortcode()

  • This answer could use some explanation. Why is your solution probably best?
    – cjbj
    Jul 12 '16 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.