Created
November 5, 2015 15:27
-
-
Save damianwajer/7fd2670fe65f4b305bf4 to your computer and use it in GitHub Desktop.
[WordPress] Allow more HTML tags and attributes in post context.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter allowed HTML elements. | |
* | |
* @param $allowedposttags | |
* @param $context | |
* | |
* @return array | |
*/ | |
function prefix_filter_allowed_html( $allowedposttags, $context ) { | |
if ( $context == 'post' ) { | |
$allowedposttags['table']['background'] = true; | |
} | |
return $allowedposttags; | |
} | |
add_filter( 'wp_kses_allowed_html', 'prefix_filter_allowed_html', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment