mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
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:
@@ -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'];
|
||||
|
||||
Reference in New Issue
Block a user