Support » Plugin: Like Button Rating ♥ LikeBtn » Does this plugin works with wp rest api

  • Resolved rish30990

    (@rish30990)


    I have mobile app which shows all data from wordpress site with help of wp rest api plugin. I also need to show post like counts on app. And need to show post likes also on app. Can this plugin send and recieve likes count info via api? If it is compatible with wp rest api then it will do it else is there any other way of it?

    • This topic was modified 5 months, 3 weeks ago by  rish30990.
Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author LikeBtn

    (@likebtn)

    Hi,
    So you need to retrieve numbder of likes for posts via REST API?

    Hi,
    Yes, I need to send no. of likes info also with post detail. If its possible to send likes count(how many likes) also with other details of post?

    • This reply was modified 5 months, 3 weeks ago by  rish30990.
    Plugin Author LikeBtn

    (@likebtn)

    You can retrieve the following post meta fields via API: “Likes”, “Dislikes”, “Likes minus dislikes”

    Check out this article to find out how: https://n8finch.com/getting-post-meta-wp-rest-api/

    That’s awesome… it is working exactly as I wanted. Thanks for the solution 🙂 . But I had to make one change in following line of code register_rest_field( 'post', 'post-meta-fields', array(. In this line I changed name from “post-meta-fields” into “post_meta_fields”. Without this change It was showing post-likes with other details of post but I couldn’t fetch value of no. of likes. After using underscore I could fetch value. Name works better with “_” instead of “-“.

    • This reply was modified 5 months, 3 weeks ago by  rish30990.

    Ok I got one issue. Not with the api but different one. Plugin is not showing no. of likes! I mean When I did like on post(after login and with mozila) then it shows digit 1 which indicates post has 1 like. But when I open same post on different browser(chrome) without login then it shows digit 1(means it has 1 like). Then I like it again and digit 1 converted into digit 2(since post has 2 likes now).

    But issue here is that when I try to reload post (on mozila with login) to see if likes has been updated or not. Then it was till showing 1 likes on post. Why is that. It must have show 2 likes. But on mozila with login its still showing only 1 like and in chrome its showing 2 like. Why? It should have update likes-count for every user.

    UPDATE
    ok after refreshing in chrome too, now its showing 1 like on each browser. Means likes is not incrementing but remains at one no matter how many users do likes. It should have show total no. of likes, shouldn’t it?

    • This reply was modified 5 months, 3 weeks ago by  rish30990.
    • This reply was modified 5 months, 3 weeks ago by  rish30990.
    • This reply was modified 5 months, 3 weeks ago by  rish30990.
    Plugin Author LikeBtn

    (@likebtn)

    Hi, I am not getting how will I specify a unique name for each like button using identifier parameter. I checked identifier link(anchor tag) too but didn’t get it there also about how to do it. I want vote to increase but not getting any idea how. Please tell me in little more detail that what I need to do to increase likes count.

    Heloo… @likebtn

    I am asking(again) for so basic info that every post-like plugin should have provide right out of the box. But here why I am struggling with so basic feature which is show no. of likes on posts? I just want that my posts shows how many likes he got. But with your plugin it’s only showing 1 like doesn’t matter how many users do like. This is first plugin I have seen having this basic issue. I don’t wanna go on other plugins coz this one is seems perfect with resp api. So if you can give me detail to show full likes-count on post then it will be great help.

    Also I need to change value of likes button from database and by changing value of likes in DB the count is not taking any effect. I need to change it from DB coz when mobile app(integrated with site) got any like on post then it will send that like to website and update query will add that likes in DB so both app and webite can show same no. of likes.

    • This reply was modified 5 months, 3 weeks ago by  rish30990.
    • This reply was modified 5 months, 3 weeks ago by  rish30990.
    Plugin Author LikeBtn

    (@likebtn)

    1) Set “Track voters by” to “Username” on Buttons tab or increase “IP Address Vote Interval” on Settings tab if your voters are voting from local network and have the same IP address. Also make sure to check “CloudFlare enabled” option on the Settings tab.

    2) You can change number of likes on the Statistics tab.

    If you are still experiencing issues, please send the link to the page to support@likebtn.com

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.