lesterchan / wp-postratings

Adds an AJAX rating system for your WordPress blog's post/page.
https://wordpress.org/plugins/wp-postratings/
124 stars 82 forks source link

WPML support #64

Closed vaclavgreif closed 6 years ago

vaclavgreif commented 8 years ago

On my site I'm using WPML. I'd like to be able to translate my posts (each translated post has different ID), but still be able to vote for the post.

Best way to do this would probably be:

Does this sound good to you? I'll be happy to do the changes needed...

lesterchan commented 8 years ago

I am not really interested in this because it seems very specific to your requirements and my aim is to make this plugin as generic as possible.

vaclavgreif commented 8 years ago

Well, WPML is the most used multilingual plugin for Wordpress, so I think people could benefit from this. I solved this by updating postmeta and saving cookie and log for all the translations. Please see

https://github.com/lesterchan/wp-postratings/compare/master...vasikgreif:patch-2

the code doesn't break anything, just adds the plugin functionality...

lesterchan commented 8 years ago

yea it doesn't break anything, but it is still specific to WPML. I rather not add in another feature that most users doesn't use. I will reconsider it if there are substantial requests. But so far, you are the first =)

vaclavgreif commented 8 years ago

We could just add a filter to enable this option - it doesn't have to be selectable in frontend, but the developers might still use it if they need to. I mean, there's no disadvantage, and I think the more features the better. I'm trying to find a way to stay upgrade safe...

lesterchan commented 8 years ago

I disagree with more features are better. It makes maintaining difficult and being bloated.

vaclavgreif commented 8 years ago

Ok, understood. than please give me an option to make this upgrade safe. Maybe just adding some actions would work for you?

lesterchan commented 8 years ago

Yeap actions are a good idea! I will take a look when I am free on what actions to add.

vaclavgreif commented 8 years ago

Thanks! Please let me know when the hooks are added, so I can adjust my code accordingly...

lesterchan commented 8 years ago

I realized that you can do it on rate_post action already.