Closed kraftbj closed 11 years ago
Correction: wp_kses_post is stripping the attribute.
Tried both:
global $allowedposttags;
$tags = array( 'div' );
$new_attributes = array( 'style' => array() );
foreach ( $tags as $tag ) {
if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) )
$allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes );
}
and
global $allowedposttags;
$allowedposttags['div'] = array( 'style' => array () );
added, both failed.
<div style="test">test</div>
works fine; not stripped. <div style="display:none;">test</div>
fails.
This is intended WP behavior to disallow the display CSS rule inline. Suggested workflow is to add class="example" and add .example { display:none;} via style.css, etc.
div style="display:none" is stripped to div when div is allowed. Look for workaround (using WP function?)