Make WordPress Core


Ignore:
Timestamp:
02/13/2012 07:22:45 AM (13 years ago)
Author:
azaozz
Message:

Add the editor ID and the post type (when available) as classes to the TinyMCE's body, fixes #19437

File:
1 edited

Legend:

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

    r19871 r19912  
    125125
    126126    public static function editor_settings($editor_id, $set) {
    127         global $editor_styles;
     127        global $editor_styles, $post;
    128128        $first_run = false;
    129129
     
    370370            }
    371371
     372            $body_class = $editor_id;
     373
     374            if ( isset($post) )
     375                $body_class .= " post-type-$post->post_type";
     376
     377            if ( !empty($set['tinymce']['body_class']) ) {
     378                $body_class .= ' ' . $set['tinymce']['body_class'];
     379                unset($set['tinymce']['body_class']);
     380            }
     381
    372382            if ( $set['dfw'] ) {
    373383                // replace the first 'fullscreen' with 'wp_fullscreen'
     
    390400                'theme_advanced_buttons2' => implode($mce_buttons_2, ','),
    391401                'theme_advanced_buttons3' => implode($mce_buttons_3, ','),
    392                 'theme_advanced_buttons4' => implode($mce_buttons_4, ',')
     402                'theme_advanced_buttons4' => implode($mce_buttons_4, ','),
     403                'body_class' => $body_class
    393404            );
    394405
Note: See TracChangeset for help on using the changeset viewer.