surveywp / kk-star-ratings

kk Star Ratings wordpress plugin
https://wordpress.org/plugins/kk-star-ratings
Other
118 stars 44 forks source link

Add kkstarratings() to init after Ajax request #101

Closed dcooney closed 1 year ago

dcooney commented 4 years ago

A user of my Ajax Load More plugin needed to be able to initiate your plugin after a post was loaded via Ajax.

I added this window scoped function that allows KK Star Rating to initiated from a callback.

window.almComplete = function(alm){
    var ratings = jQuery('.kk-star-ratings', alm.el);
    if(typeof kkstarratings === 'function' && ratings){
        window.kkstarratings(ratings);
    }
}
dcooney commented 1 year ago

Any reason in particular this couldn't get merged @kamalkhan ?

kamalkhan commented 1 year ago

The codebase has already been migrated/reworked away from jQuery long ago, hence the code you have provided is unfortunately no longer applicable.

dcooney commented 1 year ago

Nice, ok thanks. I haven't used the plugin since this PR. Good to know.