From 9aeeff79482bcb740c906e000c647966ff20511d Mon Sep 17 00:00:00 2001 From: Kyle Phillips Date: Mon, 20 Apr 2015 20:02:16 -0400 Subject: [PATCH] WP readme updated with user favorite count documentation. --- readme.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index b63af79..96859dc 100644 --- a/readme.txt +++ b/readme.txt @@ -119,7 +119,7 @@ The favorite button can be added automatically to the content by enabling specif * **Print function:** `the_favorites_button($post_id, $site_id)` * **Shortcode:** `[favorite_button post_id="" site_id=""]` -**Favorite Count** +**Favorite Count (by Post)** Total favorites for each post are saved as a simple integer. If a user unfavorites a post, this count is updated. Anonymous users' favorites count towards the total by default, but may be disabled via the plugin settings. The post id may be left blank in all cases if inside the loop. @@ -127,6 +127,13 @@ Total favorites for each post are saved as a simple integer. If a user unfavorit * **Print function:** `the_favorites_count($post_id)` * **Shortcode:** `[favorite_count post_id=""]` +**Favorite Count (by User)** +Displays the total number of favorites a user has favorited. Template functions accept the same filters parameter as the user favorites functions. + +* **Get function:** `get_user_favorites_count($user_id, $site_id, $filters)` +* **Print function:** `the_user_favorites_count($user_id, $site_id, $filters)` +* **Shortcode:** `[user_favorites user_id="" site_id="" post_types=""]` + **User Favorites** User favorites are stored as an array of post ids. Logged-in users' favorites are stored as a custom user meta field, while anonymous users' favorites are stored in either the session or browser cookie (configurable in the plugin settings). If the user id parameter is omitted, the favorites default to the current user. The site id parameter is optional, for use in multisite installations (defaults to current site).