[wp-hackers] Adding a wysiwyg editor to my admin screen?

Matthew Kettlewell ceo at kettlewell.net
Mon Oct 26 17:40:35 UTC 2009


the_editor($content) is a nice choice, and is exactly what the admin 
dashboard uses.

I'm a bit fuzzy on exactly which js files need to be included,
but here's my list I've got right now (likely bloated)

Found them online through several incomplete sources.

      wp_enqueue_script('editor');
    wp_enqueue_script('word-count');
    wp_enqueue_script('post');
    wp_enqueue_script( 'thickbox' );
    wp_enqueue_script( 'common' );
    wp_enqueue_script( 'jquery-color' );
     add_thickbox();
    wp_print_scripts('media-upload');
     wp_tiny_mce();
    wp_admin_css();
    wp_enqueue_script('utils');
    do_action("admin_print_styles-post-php");
    do_action('admin_print_styles');

When you make your call , it will look something like this:

<div id="poststuff">
  <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; 
?>" class="postarea">
  <?php
      $this_content="<h1>Groovy Content</h1>";
      the_editor($this_content, $id = 'content', $prev_id = 'title', 
$media_buttons = true, $tab_index = 2);
?>
</div>
</div>

Hope that helps you along.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Matthew Kettlewell - aka "The Dominator"
O: 970-985-4192
C: 970-261-2684
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
SEO - Social Media - Internet Marketing
Blogging - Seminars - Training - Consulting
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

http://www.BloggingEmergency.com/
http://www.MoxieMafia.com/
http://www.TheMoxieMaven.com/
http://www.Kettlewell.net/
http://www.MoxDom.com

http://www.facebook.com/moxdom
http://www.twitter.com/kettlewell




raj wrote:
> Hi all,
>
> I need to add a WYSIWYG editor in an admin screen that my plugin
> creates. I need the wysiwyg editor to be as similar to the one in the
> Add/Edit post/page screen.
>
> Instead of packaging my own wysiwyg editor for distribution, I would
> like to use the inbuilt one. How can this be done?
>
> Warm Regards,
> Raj
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list