WordPress:从下拉列表中的 single.php 更新帖子类别
我正在构建一个 HelpDesk 系统,我需要能够从前端的帖子页面 (single.php) 更新类别。我有以下代码:http://snipt.org/tlnmg1。一切都可以从前端提交帖子,但在谷歌搜索几个小时后,我陷入了停滞。有什么想法吗?
I am building a HelpDesk system and I need the ability to update a category from the post page on the front end (single.php). I have the following code: http://snipt.org/tlnmg1. Everything works on submitting the posts from the front end, but after googling for hours, I'm at a standstill. Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,我立即发现了很多问题。
首先,您生成了一组表单字段,但是当您点击“提交”时……它会去哪里?我没有看到实际的开始标签,它需要一个 action="target" 属性。目标应该进行后端处理以实际发布页面。
至于类别,您是否需要用户能够创建类别,或者只是从预定义列表中进行更改?该列表可以通过调用 get_categories() (我认为这是函数的名称)并迭代它返回的内容并将其添加到下拉列表中来填充。
最后,我看到的一个巨大问题是缺乏安全性和其他措施...如果您尝试使用复制/粘贴代码来组装它,那么您将面临一个充满伤害的世界。
您是否考虑过仅使用 bugtracker 系统或某种开源帮助台内容来代替 WordPress?
您已经偏离了软件的预期目的。
OK, there are a number of issues that I see, right off the bat.
First, you have a set of form fields that are generated but when you hit submit... where does it go? I don't see an actual start tag, which needs an action="target" attribute. The target should do the backend processing to actually post the page.
As for the categories, do you need the user to be able to create categories, or just change from a predefined list? The list can be populated by a call to get_categories() (I think that is the name of the function) and iterating through what it returns and adding that to a drop down list.
Finally, the HUGE issue I see with this is lack of security and other measures... You are opening yourself up to a world of hurt if you are trying to assemble this with copy/paste code.
Have you considered just using a bugtracker system or some sort of open source helpdesk stuff instead of wordpress?
You have drifted far afield of the intended purpose of the software.