Pass post format as a class to TinyMCE's body, props adamsilverstein, fixes #23198

git-svn-id: https://develop.svn.wordpress.org/trunk@23730 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2013-03-16 05:57:54 +00:00
parent 0132e8100c
commit e4b6b84d8e
3 changed files with 30 additions and 8 deletions

View File

@@ -396,8 +396,16 @@ final class _WP_Editors {
$body_class = $editor_id;
if ( $post = get_post() )
$body_class .= ' post-type-' . $post->post_type;
if ( $post = get_post() ) {
$body_class .= ' post-type-' . sanitize_html_class( $post->post_type ) . ' post-status-' . sanitize_html_class( $post->post_status );
if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
$post_format = get_post_format( $post );
if ( $post_format && ! is_wp_error( $post_format ) )
$body_class .= ' post-format-' . sanitize_html_class( $post_format );
else
$body_class .= ' post-format-standard';
}
}
if ( !empty($set['tinymce']['body_class']) ) {
$body_class .= ' ' . $set['tinymce']['body_class'];