动态生成的Word preSS所见即所得的编辑器(wp_editor)显示不正常 [英] Dynamically generated Wordpress Wysiwyg Editor ( wp_editor ) not displaying properly

查看:1350
本文介绍了动态生成的Word preSS所见即所得的编辑器(wp_editor)显示不正常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个词preSS管理页面上2 HTML所见即所得的编辑器。两者都使用WP_EDITOR()函数。第一个是硬codeD插入页面:

I have 2 html wysiwyg editors on a wordpress admin page. Both use WP_EDITOR() function. The first one is hard coded into the page:

<form name="form1" id="form1" method="post" action="" style="display:block;">
  <p>
    <!-- editor here -->
    <?php
       wp_editor( 'CONTENT WILL APPEAR HERE!', 'addsometxt', array('textarea_name'=>'create_txt','textarea_rows'=>10,'wpautop'=>false));
    ?>
  </p>
  <p>
   <input name="save" type="submit" class="button-primary" id="save" style="margin:5px;" value="Save Input" /></p>
</form>

第二个是动态地使用AJAX调用(wp_ajax_和$。员额)PHP函数生成的。我已经测试Ajax调用,并知道它的工作原理;因此,为简单起见,这里的PHP函数:

The second one is generated dynamically with a PHP function using an AJAX call (wp_ajax_ and $.post). I've test the ajax call and know it works; so, for brevity, here's the php function:

<?php
function display_editor2() {
// grab data from database (data_from_db) and display in editor
  wp_editor( $row->data_from_db, 'editsometxt', array('textarea_name'=>'edit_txt','textarea_rows'=>10,'wpautop'=>false));

} 
?>

的问题是,即使第二编辑器显示;它丢失了所有的工具栏按钮。请参阅下面的插图图像。任何人都知道谁解决这一问题?

The problem is that even though the 2nd editor is displaying; it's missing all the tool bar buttons. See image below for illustration. Anyone know who to fix this?

推荐答案

我有同样的问题。

当我添加了code &LT; PHP wp_footer(); ?&GT; 在我的footer.php,它的工作原理

When I add the code <?php wp_footer(); ?> in my footer.php, it works.

这篇关于动态生成的Word preSS所见即所得的编辑器(wp_editor)显示不正常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆