I am currently linking each WordPress comment to a particular sentence or phrase found in the post content. I call that a thread and one post can have several threads:
- post: the post id
- phrase: the sentence found in the content
- occurrence: the occurrence (in case that phrase appears several times in the content)
- collection: the collection of comments belonging to this thread (post_id+phrase+occurrence)
How would you save that in the database so it is efficient but also clean and can be expended in the future in case I want to add/alter features?
Option 1 - Just save the phrase and occurrence as comment meta and when outputting the_content, retrieve all comments, parse the various threads and alter the_content accordingly ( around each phrase)
Option 2 - Create a Thread custom post type (or table?!) and save each thread (ie. the post id, phrase, occurrence) and then save the thread_id as a comment meta?
What makes more sense in your opinion?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire