HAIDY :
These updates can be made to the set_favorite() method.
set_favorite()
• Add or remove row in wp_postworld_favorites, with user_id and post_id
• If it was added or removed, add 1 or subtract 1 from table wp_postworld_post_meta in column favorites
That is all for now. The rest of the favorites methods will still operate in the same way. This new favorites DB table will allow us to see how many people have favorited each post, and also it will allow us to query on favorites in the future.
Hi Haidy, There is a small adjustment to the favorites method which will allow for more flexibility in the future. Here are the adjustments :
PHONG :
The documentation has been updated to reflect this changes : https://www.evernote.com/shard/s275/sh/7fd5bb62-0902-4050-9889-338f847d044c/5fe6f3da3510557663e8693251ac8557
HAIDY : These updates can be made to the set_favorite() method.
That is all for now. The rest of the favorites methods will still operate in the same way. This new favorites DB table will allow us to see how many people have favorited each post, and also it will allow us to query on favorites in the future.