2

我编写了一个 Text/HTML 小部件,它使用 TinyMCE 来允许一些基本格式。但是,当我保存更改时,文本区域中的数据不会被发布。如果我只使用一个没有 TinyMCE 的简单文本区域,那么我可以正确保存数据。有任何想法吗?

4

2 回答 2

1

I've experienced this issue recently as well. Just solved it, actually. :)

If you write a PHP function to include your tinyMCE code and run the Javascript init, you can include that in admin_head

add_action( 'admin_print_scripts-widgets.php', 'NAME OF YOUR INIT FUNCTION HERE' );

Currently I've also go the following in my init function. although I'm not certain it's needed in this context:

wp_enqueue_script( 'editor' );
wp_enqueue_script( 'editor_functions' );
wp_enqueue_script( 'quicktags' );

Hope this helps. :)

于 2009-06-01T07:59:47.480 回答
0

它会发布吗?做一个

<?php print_r($_REQUEST); ?>

在其发布到的页面上,查看是否正在传递值。99% 的时间是打字错误,也许是 textarea 名称错误。

于 2009-05-11T05:12:19.113 回答