Skip to content

REST API

Likes: 7 routes.

All under /wp-json/davo/v1. Every route has a description in the source.

  • GET6
  • POST2
  • DELETE1

/likes/{type}/{id}

GETPublic

Returns the like count for an item and whether the current user has liked it.

Handler: get_status()

No parameters declared in the route registration.

curl
curl "https://example.com/wp-json/davo/v1/likes/{type}/{id}"

POSTAccess check: require_login

Adds the current user's like to an item. Subject to the like rate limit.

Handler: add_like()

No parameters declared in the route registration.

curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/likes/{type}/{id}"

DELETEAccess check: require_login

Removes the current user's like from an item. Subject to the like rate limit.

Handler: remove_like()

No parameters declared in the route registration.

curl
curl -X DELETE -u "user:application-password" "https://example.com/wp-json/davo/v1/likes/{type}/{id}"

src/domains/likes/routes.php:96

/likes/{type}/{id}/likers

GETPublic

Lists the members who liked an item, with pagination. Totals are returned in the X-WP- Total and X-WP-TotalPages headers.

Handler: get_likers()

No parameters declared in the route registration.

curl
curl "https://example.com/wp-json/davo/v1/likes/{type}/{id}/likers"

src/domains/likes/routes.php:148

/likes/{type}/{id}/toggle

POSTAccess check: require_login

POST /likes/{type}/{id}/toggle New — parity with Bookmarks_Routes::toggle_bookmark().

Handler: toggle_like()

No parameters declared in the route registration.

curl
curl -X POST -u "user:application-password" "https://example.com/wp-json/davo/v1/likes/{type}/{id}/toggle"

src/domains/likes/routes.php:128

/likes/me

GETAccess check: require_login

Lists the items the current user has liked, optionally by type, with pagination.

Handler: get_my_liked()

Parameters of GET /likes/me
ParameterTypeRequiredDefault or allowed values
typestring—(empty)
pageinteger—1
per_pageinteger——
curl
curl -u "user:application-password" "https://example.com/wp-json/davo/v1/likes/me"

src/domains/likes/routes.php:186

/likes/most-liked

GETPublic

Returns the most-liked items, by type, count and period.

Handler: get_most_liked()

Parameters of GET /likes/most-liked
ParameterTypeRequiredDefault or allowed values
typestringYes—
countinteger—5
periodinteger—30
curl
curl "https://example.com/wp-json/davo/v1/likes/most-liked?type=…"

src/domains/likes/routes.php:228

/likes/most-liked-comments

GETPublic

Returns the most-liked comments, optionally for one post.

Handler: get_most_liked_comments()

Parameters of GET /likes/most-liked-comments
ParameterTypeRequiredDefault or allowed values
countinteger—5
post_id——null
curl
curl "https://example.com/wp-json/davo/v1/likes/most-liked-comments"

src/domains/likes/routes.php:271

/likes/trending

GETPublic

Returns trending items, by type and count.

Handler: get_trending()

Parameters of GET /likes/trending
ParameterTypeRequiredDefault or allowed values
typestringYes—
countinteger—5
curl
curl "https://example.com/wp-json/davo/v1/likes/trending?type=…"

src/domains/likes/routes.php:307

Note. Generated from the plugin source. Parameters are the ones declared when the route is registered; a parameter marked “see source” uses a shared definition. Responses are not documented here. Authenticate as for any WordPress REST route, for example with an application password over HTTPS; the example paths use https://example.com.

See it on your own site.

Davo is a WordPress theme and plugin by Exorex.

  • Runs on your own WordPress
  • Guided setup wizard
  • AI is off until you switch it on
  • Read the licence on the marketplace first