Hmm. That code worked on my dev site.
1. If you're testing with an article that has already been autoposted, you will need to delete the entries in the JFBConnect backend > Channels > History tab. If we detect the post, we don't attempt the autopost action again. Once deleted, try the unpublish/publish action again.
2. If there were no prior autoposts for the URL, can you see if there are any error entries in that History tab? Sometimes the attempt is made to post but the actual posting fails and there are API errors in that list.
3. Can you verify that we're performing the same action on the front-end? The screenshot has the button that I'm toggling in the listing itself to unpublish and publish the JReviews listing. Are you doing it within the listing or from a category list of listings?
-Melissa