Skip to content

Commit

Permalink
WP readme updated with user favorite count documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
kylephillips committed Apr 21, 2015
1 parent e8984a8 commit 9aeeff7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,21 @@ 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.

* **Get function:** `get_favorites_count($post_id)`
* **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).
Expand Down

0 comments on commit 9aeeff7

Please sign in to comment.