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

Gregory Lancaster greglancaster71 at gmail.com
Mon Nov 11 18:14:28 UTC 2013


The idea was actually to do both.  Show on a single post the number of
people who liked it, and on mouseover list the user IDs of the folks who
did.  Then on their profile page have a "this user liked 6 posts" or
whatever it may be, and have that be clickable to open a new page with the
lists of posts they liked.


On Mon, Nov 11, 2013 at 10:12 AM, chriscct7 <hello at chriscct7.com> wrote:

> 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.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list