benlag
Forum Replies Created
Viewing 6 replies - 1 through 6 (of 6 total)
-
Forum: Plugins
In reply to: Utilizing TinyMCE Editor in a Plug InForum: Plugins
In reply to: Plugin to replace page editor on selected pagesForum: Plugins
In reply to: trying to use the tiny_mce editor within a pluginHi,
Had to do this myself recently. I’ve worked it out from the source after a bit of testing.
I’ve posted the solution to this thread:
http://wordpress.org/support/topic/222226Ben
Forum: Plugins
In reply to: Adding rich text editing to your plugin?Hi,
I came across your post a while back, I was trying to do that too.
Haven’t found an answer but I did work it out from the code. So here it is.
/** In main plugin file **/ add_action('admin_print_scripts', 'do_jslibs' ); add_action('admin_print_styles', 'do_css' ); function do_css() { wp_enqueue_style('thickbox'); } function do_jslibs() { wp_enqueue_script('editor'); wp_enqueue_script('thickbox'); add_action( 'admin_head', 'wp_tiny_mce' ); } /** Then wherever needed **/ <div id="poststuff"> <?php the_editor('<h2>Some content</h2>','content'); ?> /* 'content' is the id of the control and the name of the hidden textarea created.*/ </div>Note: if the id is different than ‘content’ it doesn’t automatically load the visual mode for some reason. That can be fixed with a call to switchEditors.go(‘theid’, ‘tinymce’); after the document is ready (jQuery.ready(…));
Hope this helps someone one day
Ben
Forum: Plugins
In reply to: add_menu_page always add an extra subpageHi djboling,
Thanks for the help. That does fix the problem, nice one.
Ben
Forum: Plugins
In reply to: add_menu_page always add an extra subpageAnyone?
Viewing 6 replies - 1 through 6 (of 6 total)