[wp-hackers] Center in WP 2.7 with different code in the editor

Rich Pedley elflop at googlemail.com
Wed Jan 14 13:50:08 GMT 2009


2009/1/14 Mário Gamito <gamito at gmail.com>:
> Hi,
>
> I've posed here this very same question a long ago in the WP 2.5 time.
>
> Wp 2.7 TinyMCE center aligns objects with <p style="text-align: center;">
> And that's fine and what it should be.

> The center code it recognizes unversaly is <p align="center"> which is
> kind of old-fashioned, but still does the job and above all, works well
> with Planet.
>
> When I asked here how to force WP 2.5 TinyMCE to center with <p
> align="center"> instead of <p style="text-align: center;">, someone
> responded:
>
> "The easiest hack would be to add:
>
> content = content.replace(/<p style="text-align: center;">/g, '<p>
> align="center">');
>
> just above "// Pretty it up for the source editor" in
> wp-admin/js/editor.js."
>
> And it worked.
>
 Can this rather convulated system recognise class="" and apply things
correctly?

Editing core files should be avoided. It might be better to look at
ways of adding to the tiny mce bar via a plugin - not sure if
http://wordpress.org/extend/plugins/tinymce-advanced/
would help here.

Rich
(I don't use tinymce)

-- 
my mind is on a permanent tangent
http://cms.elfden.co.uk/


More information about the wp-hackers mailing list