[wp-hackers] Like Posts - Store Data in DB, User_Meta or Post_Meta

chriscct7 hello at chriscct7.com
Mon Nov 11 18:12:49 UTC 2013


It depends why you are storing it. If you store it in user_meta, to say make
a feature that lets users find the posts they favorited, you can get all the
posts in a single query to the user_meta, versus querying all posts that
have a meta_key with a meta_value that contains a given user->ID. Now if you
are making a feature where you want to know who favorited a post, store all
the user->Id's in a post_meta. Then for a given post you can query a single
post_meta versus querying all users with a given meta_key with a meta_value
that contains a given post->ID





--
View this message in context: http://wordpress-hackers.1065353.n5.nabble.com/Like-Posts-Store-Data-in-DB-User-Meta-or-Post-Meta-tp42769p42770.html
Sent from the Wordpress Hackers mailing list archive at Nabble.com.


More information about the wp-hackers mailing list