| 开发者 |
oacstudio
conschneider |
|---|---|
| 更新时间 | 2026年7月16日 05:25 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[oacsspl] — the like button. Arguments: post_id, counter=off to hide the count for that instance.[oacsspltop count=5 post_type=post] — the most-liked posts, with counts. Add days=7 for trending (most likes in the last 7 days).[oacsspllist] — the posts the current user likes. Add user_id=123 to show a specific user's likes.[oacs_spl_profile] — same list, table style.GET /wp-json/spl/v1/likes/<id> and POST /wp-json/spl/v1/likes/<id>/toggle — for headless and mobile use (Application Passwords supported).before_oacs_spl_button / after_oacs_spl_button filters for custom content around the button./wp-content/plugins/solid-post-likes directory, or install the plugin through the WordPress plugins screen directly.No. This plugin uses the same button for like and unlike. You can however set different icons for the liked and unliked state.
Yes. Use [oacsspltop count=10] to show the most-liked posts sorted by likes, and sort the admin post list by the Likes column.
Yes. Enable "Enable Likes in Archives and Query Loops" in the settings. The shortcode then also works in custom loops via do_shortcode( '[oacsspl]' ).
Yes. Enable "Only Logged-in Users Can Like". The button and count stay visible for visitors; clicking sends them to the login page or a custom URL of your choice.
Yes. Enable "Enable full page caching support" in the Developer tab. Buttons then fetch their live state (and a fresh security nonce) on page load.
In a limited way. Use [oacsspllist] to show the posts the current user likes, or [oacsspllist user_id=123] for a specific user.
Yes. [oacsspltop days=7] lists the posts with the most likes recorded in the last 7 days. Likes made before 1.2.0 count towards the post's last like date.
Yes, since 1.2.0. GET /wp-json/spl/v1/likes/<id> returns the count, whether the current visitor liked it, and a nonce. POST /wp-json/spl/v1/likes/<id>/toggle likes/unlikes — authenticate with an Application Password (headless/mobile) or pass the nonce from the GET response. Comments: add ?type=comment.
Your existing likes and counts are kept. Likes move into a dedicated database table the first time each post is viewed or liked; the old data stays in place untouched as a safety net. One caveat: if you downgrade to 1.1.x and later upgrade again, likes made during the downgrade window are not merged back — the post returns to its pre-downgrade state.
GET /wp-json/spl/v1/likes/<id> and POST /wp-json/spl/v1/likes/<id>/toggle (Application Passwords supported).[oacsspltop days=7] ranks by likes recorded within the window.[oacsspllist user_id=123] — show a specific user's liked posts.[oacsspllist] and the profile likes list were capped at 10 posts.[oacsspltop] shortcode — list the most-liked posts (count, post_type, show_count attributes).counter=off attribute on [oacsspl] — hide the counter per instance.count(): Argument #1 ($value) must be of type Countable|array when a like targeted an invalid post or comment ID.[oacsspllist] printed broken list markup and queried with user ID 0 for visitors — visitors now get a login hint.solid-post-likes so translations can be delivered via wordpress.org language packs.