我需要在Wysiwyg编辑器中使用TextArea。当textarea在页面上写入时(不是动态的、静态的)。但我的问题是动态文本区域。
我的代码:
add_action('admin_head', 'load_tiny_mce');
function load_tiny_mce() {
// The 'mode' and 'editor_selector' options are for adding
// TinyMCE to any textarea with class="tinymce-textarea"
wp_tiny_mce(true, array(
'mode' => 'specific_textareas',
'editor_selector' => 'tinymce-textarea'
));
}当我按下按钮时,我添加了带有javascript代码的textarea。文本区域是基本的,不是用wysiwyg编辑器.!我想我需要绑定函数..。但是该怎么做!
希望你能理解我..。好了!
问候
发布于 2011-11-23 21:33:45
将此函数添加到JavaScript中:
function textarea_to_tinymce(id){
if ( typeof( tinyMCE ) == "object" && typeof( tinyMCE.execCommand ) == "function" ) {
tinyMCE.execCommand('mceAddControl', false, id);
}
}然后,当您创建textarea时,动态地调用它并将textarea的id传递给它。
只需确保TinyMCE之前已加载在该页面上,否则它将无法工作。
发布于 2012-01-10 16:00:39
注释上的任何回复按钮都是自动的,例如:
<a class="comment-reply-link"
href="/post_url/?replytocom=187#respond"
onclick="addComment.moveForm("comment-" + id , id , "respond",
response) >Beantwoorden</a据我现在所发现,您不能将onclick事件更改为可以添加此execCommand的某个函数。
也许这一页能帮你:
http://codex.wordpress.org/Function_Reference/comment_reply_linkhttps://wordpress.stackexchange.com/questions/34596
复制相似问题