0

Is it possible to make a comment out of a post that already exists (with the same name). For example, if the post 'Hello World' exists and a users posts another 'Hello World' post, it should make the second post a comment beneath the first post... How can I do this?

1

You can use get_page_by_title http://codex.wordpress.org/Function_Reference/get_page_by_title to check if another page/post is using the same title. If so, get the content of that post and insert it using wp_insert_comment, and delete the original post with wp_delete_post. Finally, glue all these together inside the save_posts action hook.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.