Make WordPress Core


Ignore:
Timestamp:
03/16/2013 05:57:54 AM (13 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-editor.php

    r23123 r23730  
    397397            $body_class = $editor_id;
    398398
    399             if ( $post = get_post() )
    400                 $body_class .= ' post-type-' . $post->post_type;
     399            if ( $post = get_post() ) {
     400                $body_class .= ' post-type-' . sanitize_html_class( $post->post_type ) . ' post-status-' . sanitize_html_class( $post->post_status );
     401                if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
     402                    $post_format = get_post_format( $post );
     403                    if ( $post_format && ! is_wp_error( $post_format ) )
     404                        $body_class .= ' post-format-' . sanitize_html_class( $post_format );
     405                    else
     406                        $body_class .= ' post-format-standard';
     407                }
     408            }
    401409
    402410            if ( !empty($set['tinymce']['body_class']) ) {
Note: See TracChangeset for help on using the changeset viewer.