Skip to content

Instantly share code, notes, and snippets.

@titomus
Created February 2, 2017 16:04
Show Gist options
  • Select an option

  • Save titomus/f0a8cf50d6a44f7ef43fb67ca939c8c0 to your computer and use it in GitHub Desktop.

Select an option

Save titomus/f0a8cf50d6a44f7ef43fb67ca939c8c0 to your computer and use it in GitHub Desktop.
Autoriser les shortcodes dans les tags html (pour les formulaires)
<?php
#shortcode dans input form
add_filter( 'wp_kses_allowed_html', 'allow_tag_in_input', 10, 2 );
function allow_tag_in_input( $allowedposttags, $context ) {
if ( $context == 'post' ) {
$allowedposttags['input']['value'] = 1;
}
return $allowedposttags;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment