619 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
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’);

1470 posts
  • Has been a member for 2-3 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
  • Bought between 10 and 49 items
  • Referred between 1 and 9 users
  • Croatia
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.

619 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 3-4 years
  • Sold between 10 000 and 50 000 dollars
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! :)

by
by
by
by
by
by