admin管理员组文章数量:1134247
Using an API plugin i have been able to build a site that combines content from multiple Wordpress websites. I want to give users the ability to quickly leave a comment for one of these posts without having to navigate to the source website. I was able to copy the comment code from the source site, but the form redirects to the source website.
I was thinking the easiest way around all of this would be to just directly insert the comment into wp_comments. The table structure is very simple and shouldnt cause any trouble. Is this the best solution or is there something i am unaware of that could solve this problem.
Using an API plugin i have been able to build a site that combines content from multiple Wordpress websites. I want to give users the ability to quickly leave a comment for one of these posts without having to navigate to the source website. I was able to copy the comment code from the source site, but the form redirects to the source website.
I was thinking the easiest way around all of this would be to just directly insert the comment into wp_comments. The table structure is very simple and shouldnt cause any trouble. Is this the best solution or is there something i am unaware of that could solve this problem.
Share Improve this question asked Jul 18, 2016 at 15:32 user1889580user1889580 4621 gold badge4 silver badges18 bronze badges1 Answer
Reset to default 1This quite rare setup so it is hard to recommend one way or another.
Having worked with comments before I would recommend to stick with WordPress API functions (wp_insert_comment()
and so on) for manipulating them. While DB structure is indeed simple you don't account for all the hooks firing and other things that might be happening.
For example once in the past I had been deleting comments from database directly for reasons... And then one day found years worth of orphan metadata for them that had been left behind. :)
本文标签: apiHow to create post comment from different domain
版权声明:本文标题:api - How to create post comment from different domain 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736816824a1954121.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论