N
N
Nikolai Antal2013-06-12 18:14:02
JavaScript
Nikolai Antal, 2013-06-12 18:14:02

TinyMCE: editor initialization

Good evening everyone.
There was a problem when launching the TinyMCE editor, namely: during initialization, it complains about the inability to load the language pack. All this happens on the wordpress 3.5.1 engine, it already has a tinyMCE editor, which is used (it's stupid to load it from somewhere else).
How everything happens.
Connecting the editor

wp_enqueue_script('tiny_mce', get_option('siteurl') . '/wp-includes/js/tinymce/tiny_mce.js', false, '3');

When inserting a picture, I try to launch the editor
tinyMCE.init({
  mode : "exact",
  elements : editorID, // идентификатор textarea
  language: 'wp-langs-en'
});

But I get the error
" Failed to load: host /wp-includes/js/tinymce/themes/advanced/langs/wp-langs-en.js ", which is logical, because there is no advanced folder at all :(. Create a folder and upload the script there not an option, it can be overwritten during the update.Is
it possible to somehow specify when initializing to take languages ​​​​from another folder?

Or maybe someone else knows another way to connect the editor, so that this problem can be avoided?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan, 2013-06-13
@rOOse

Why not just use wp_editor

R
Ruslan, 2013-06-13
@rOOse

Are you adding in the admin? If there, then it works for me like this:

  tinyMCE.init({
    theme : "advanced",
    mode: "exact",
    language: "",
    elements : "description"
  });

There is an advanced folder, but there are no languages ​​in it, you can see that languages ​​are loaded in the WP in their own way, through tinymce\langs\wp-langs.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question