I want to add WordPress editor dynamically using jquery in my custom plugin as follow:
<?php
$content = '';
$editor_id = 'mycustomeditor';
?>
$('#container').append('<?php wp_editor( $content, $editor_id );?>');
I am getting error:
SyntaxError: missing ) after argument list
...-active"><link rel='stylesheet' id='editor-buttons-css' href='http://localhost
I have also tried bellow code(here I have replaced single quotes to double quotes):
<?php
$content = '';
$editor_id = 'mycustomeditor';
?>
$('#container').append("<?php wp_editor( $content, $editor_id );?>");
I am getting error:
SyntaxError: missing ) after argument list $('#container').append("<div id="wp-mycustomeditor-wrap" class="wp-core-ui wp-ed...
If you have any solution please let me know.
Thanks in advance
I know late answer. but it will help others. Try this jQuery plugin.
https://github.com/anteprimorac/js-wp-editor
you can use simple like below
I think the problem is you are using single inverted comma here:
and here:
Try with double inverted commas, and see if that helps.
you nee comment internal char (“) and change wp_ by the_ to get string.
in php:
in script replace: