# Functions

URL: https://wpusermanager.com/article/322-functions/
Last updated: 2023-01-02

The WP User Manager Likes addon has some functions that can be used in templates to access certain data.

**wpumli\_get\_likes\_count( $post\_id )**

This function will return the number of likes a piece of content has, when supplied with the ID of that post, page or custom post type.

**wpumli\_get\_likes\_by\_user( $user\_id, $post\_type = null )**

This function will return an array of post IDs for the content a user has liked. You can optionally pass a post type string to only get the likes for a specific post type.

**wpumli\_get\_users\_who\_liked\_post( $post\_id )**

This function will return an array of user IDs who have like a piece of content.

**wpumli\_get\_liked\_posts\_for\_profile( $user\_id, $post\_type = null )**

This function returns the liked content for a user and is used to render the profile content on the Likes tab. It is pluggable so you can overwrite this function in your own code.
