647 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
ChapterThemes says

Using the wp_editor() function is an easy thing, but it won’t work when i try to call it on a custom empty page without the needed styles and scripts loaded.

In the old day you could use:

add_filter('admin_head','ShowTinyMCE'); function ShowTinyMCE() { // conditions here wp_enqueue_script( 'common' ); wp_enqueue_script( 'jquery-color' ); wp_print_scripts('editor'); if (function_exists('add_thickbox')) add_thickbox(); wp_print_scripts('media-upload'); if (function_exists('wp_tiny_mce')) wp_tiny_mce(); wp_admin_css(); wp_enqueue_script('utils'); do_action("admin_print_styles-post-php"); do_action('admin_print_styles'); }

To load all the needed scripts and then activate your editors, but wp_tiny_mce is deprecated since wp 3.3, and now i’m wondering.. what hooks etc. to use to manually load all the needed scripts and styles?

Anyone?

You have:

wp_enqueue_script('tiny_mce'); wp_enqueue_script('editor'); wp_enqueue_script('media-upload'); wp_enqueue_script('editor-functions');

But that doesn’t seem to be enough… wp_enqueue_script(‘common’);

1509 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+2 more
OriginalEXE says

Are you sure it does not work itself? I remember using it and I think I did not enqueue any scripts or styles, the function handles that I believe.

Check the function description: Using this function is the proper way to output all needed components for both TinyMCE and Quicktags.

647 posts
  • Has been part of the Envato Community for over 3 years
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
ChapterThemes says

Yeah it works great and easy on pages…

But my problem is i’m busy loading things through ajax…

So i wonder if i could figure out what kind of things are output by it, the scripts etc. Or if there’s a way i could catch it…

But i’ll find a way! :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by