David Gwyer and company over at PressCoders have posted an in depth rundown on how to integrate the native WordPress post editor into plugins. They’ll also have you going a step further and showing you how to set up multiple instances of it on the same page.
We’ve all seen plugins where the developer tried to reinvent the wheel. It might work great, but the user interface is riddled with fields and buttons that look like they came out of a horror movie. The post makes mention of some new functions like wp_editor()
in WordPress 3.3 that should make it easier to standardize the user interface for plugin developers. When using plugins, how important is it that the interface looks similar to the native WordPress admin?
A few other developers and I collaborate on a code library for easily making in-post metaboxes in plugins and themes.
Code: https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress/tree/trunk
Wiki: https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress/wiki
Just wanted to mention that we’ve had a ‘wysiwyg’ field type in there since the beginning, and with WP 3.3 this will automatically use the new editor. (Make sure you download trunk though. We haven’t deployed this code to ‘master’ yet, GitHub’s equivalent to the stable tag).
So if you’re looking for an easy way to add wysiwyg boxes, this replaces all the code you see in the PressCoders tutorial with a simple array.
Interesting timing on this as I just posted “How to Add Multiple TinyMCE Editors to Your WordPress Theme or Plugin” on our Max Foundry blog yesterday as well. My post doesn’t take into consideration the new wp_editor() function in WP 3.3, but the solution is rather quite simple to use and straightforward.
Thanks for letting us know about it Dave- I’m sure the people who need these are interested in multiple viewpoints as well.