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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

This 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