/** * Sanitization: html * Control: textarea * * Sanitization callback for 'html' type text inputs. This * callback sanitizes $input for HTML allowable in posts. * * https://codex.wordpress.org/Function_Reference/wp_kses * https://gist.github.com/adamsilverstein/10783774 * https://github.com/devinsays/options-framework-plugin/blob/master/options-check/functions.php#L69 * http://ottopress.com/2010/wp-quickie-kses/ * * @uses wp_filter_post_kses() https://developer.wordpress.org/reference/functions/wp_filter_post_kses/ * @uses wp_kses() https://developer.wordpress.org/reference/functions/wp_kses/ */ function theme_slug_sanitize_html( $input ) { global $allowedposttags; return wp_kses( $input, $allowedposttags ); /* $allowed = array( 'a' => array( 'href' => array(), 'title' => array(), 'target' => array(), 'class' => array() ), 'br' => array(), 'em' => array(), 'strong' => array(), 'p' => array( 'class' => array() ) ); */ //return wp_kses( $input, $allowed ); //return wp_post_kses( $input ); //return wp_filter_post_kses( $input ); }