I want to add some custom behaviour to my TinyMCE body, but I can't reference it in my script.

This is how I load my scripts inside my WordPress plugin:

$this->loader->add_filter( 'mce_external_plugins', $plugin_admin, 'tome_editor_tinymce' );

function tome_editor_tinymce( $plugin_array ) {
    $plugin_array['myplugin'] = plugins_url( '/js/tome-editor.js',__FILE__ );

    return $plugin_array;

And this is how I try to reference TinyMCE body in my tome-editor.js:


But, jQuery says that $('#tinymce').length is 0

What am I doing wrong?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.