Return to Snippet

Revision: 53599
at November 29, 2011 09:07 by f6design


Initial Code
/**
 * Ensure TinyMCE is loaded.
 * Required to use TinyMCE in meta boxes.
 */
add_action("admin_head","myplugin_load_tiny_mce");

function myplugin_load_tiny_mce() {
	wp_tiny_mce( false ); // true gives you a stripped down version of the editor
}

Initial URL


Initial Description
If you are creating a custom post type in Wordpress, and turn off the 'editor' capability, then TinyMCE is not loaded. This means any WYSIWYG meta box textareas will fail. Add this snippet to your theme's functions.php file to load the required TinyMCE JS and styles.

Initial Title
Ensure TinyMCE is loaded for Wordpress (for meta boxes)

Initial Tags
wordpress

Initial Language
PHP