Which WP database tables should I use?
-
I’ve created a custom post type called Video and I’m storing additional fields such as the url of the video and it’s description in the Post Meta table.
Would it be better design to create my own database table rather than storing the video ID and Title in the WP’s default Posts table and then it’s other fields in the Post Meta table?
Also, I want users to be able to tick a checkbox to choose whether it’s the video featured on the home page.
Where would be the best place to store this information? I’m thinking I could write to the WP Options table – option_name = homepagevideo, option_value = post ID of video, then when viewing the ‘edit video post page’, query the value to see if it matches the ID of the current video to display the box either checked/unchecked.
How can I write to the Options table? Or perhaps there’s a better way?
The topic ‘Which WP database tables should I use?’ is closed to new replies.