WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to use a shortcode in any content area for WP's theme customizer, it doesn't compile it. If I wrap it in PHP, it doesn't show up.

I think it might be because I'm sanitizing the content, but I'm not sure what to do to make shortcodes not get sanitized/removed.

function contents_sanitize_text( $input ) {
return wp_kses_post( force_balance_tags( $input, array( 'strong' => array(), 'a' => array('href') ) ) );
}

For this example, I want to add the shortcode [mc4wp_form id="148"] to a textarea in my theme's customizer.

share|improve this question
    
Shortcodes would need processing at the moment you display it, not when you sanitise it – Tom J Nowell 2 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.