【发布时间】:2012-12-18 01:01:04
【问题描述】:
我目前正在为 Wordpress 编写一个聊天框插件。
该插件使用 jQuery.post() 方法将数据发送到 php 文件,以便将输出写入 html 文件,然后使用 jQuery 将其加载到聊天窗口。
在我用来将聊天记录写入 html 文件的 php 文件中,我需要使用 Wordpress API 函数,但 Wordpress 不包含此 php 文件,因此无法访问 Wordpress API。
有没有办法将此聊天数据发送到 Wordpress 包含的 php 文件,以便我可以使用 Wordpress API?解决这个问题的最佳方法是什么?
【问题讨论】:
-
WordPress Codex 是个好地方:codex.wordpress.org/Writing_a_Plugin
-
@valentinas 在过去的 2 个小时里,我一直在研究法典,试图找到我问题的答案。我没有找到它,所以我想我会在这里尝试。