sha*_*ank 9 jquery wordpress-plugin wp-editor
我想在我的自定义插件中使用jquery动态添加WordPress编辑器,如下所示:
<?php
$content = '';
$editor_id = 'mycustomeditor';
?>
$('#container').append('<?php wp_editor( $content, $editor_id );?>');
Run Code Online (Sandbox Code Playgroud)
我收到错误:
参数列表后面的SyntaxError:missing)
Run Code Online (Sandbox Code Playgroud)...-active"><link rel='stylesheet' id='editor-buttons-css' href='http://localhost
我也尝试过波纹管代码(这里我用单引号代替双引号):
<?php
$content = '';
$editor_id = 'mycustomeditor';
?>
$('#container').append("<?php wp_editor( $content, $editor_id );?>");
Run Code Online (Sandbox Code Playgroud)
我收到错误:
Run Code Online (Sandbox Code Playgroud)SyntaxError: missing ) after argument list $('#container').append("<div id="wp-mycustomeditor-wrap" class="wp-core-ui wp-ed...
如果您有任何解决方案,请告诉我.
提前致谢
我知道迟到的答案。但这会帮助其他人。试试这个 jQuery 插件。
https://github.com/anteprimorac/js-wp-editor
你可以使用像下面这样简单的
jQuery(document).ready(function (){
jQuery('#container').wp_editor();
});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1475 次 |
最近记录: |