Make WordPress Core


Ignore:
Timestamp:
10/29/2010 08:06:00 PM (16 years ago)
Author:
azaozz
Message:

Editor: utilize the new "formats" option in TinyMCE, fix errors in IE when pressing Enter inside a caption box, fix resizing of the caption box when the user soft-resizes the image in the editor, fixes #12574

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r16004 r16090  
    14431443                'theme_advanced_resize_horizontal' => false,
    14441444                'dialog_type' => 'modal',
     1445                'formats' => "{
     1446                        alignleft : [
     1447                                {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'left'}},
     1448                                {selector : 'img,table', classes : 'alignleft'}
     1449                        ],
     1450                        aligncenter : [
     1451                                {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'center'}},
     1452                                {selector : 'img,table', classes : 'aligncenter'}
     1453                        ],
     1454                        alignright : [
     1455                                {selector : 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li', styles : {textAlign : 'right'}},
     1456                                {selector : 'img,table', classes : 'alignright'}
     1457                        ],
     1458                        strikethrough : {inline : 'del'}
     1459                }",
    14451460                'relative_urls' => false,
    14461461                'remove_script_host' => false,
     
    15271542
    15281543        $mce_options = '';
    1529         foreach ( $initArray as $k => $v )
    1530             $mce_options .= $k . ':"' . $v . '", ';
     1544        foreach ( $initArray as $k => $v ) {
     1545                if ( is_bool($v) ) {
     1546                        $val = $v ? 'true' : 'false';
     1547                        $mce_options .= $k . ':' . $val . ', ';
     1548                        continue;
     1549                } elseif ( is_string($v) && ( '{' == $v{0} || '[' == $v{0} ) ) {
     1550                        $mce_options .= $k . ':' . $v . ', ';
     1551                        continue;
     1552                }
     1553
     1554                $mce_options .= $k . ':"' . $v . '", ';
     1555        }
    15311556
    15321557        $mce_options = rtrim( trim($mce_options), '\n\r,' ); ?>
Note: See TracChangeset for help on using the changeset viewer.