Fires when a like is added or taken away, and once the likes a visitor kept in this browser have joined their account after they signed in.
Also dispatched as the riff:like event on #riff, with the same detail. The event bubbles.
Parameters
detailObject- What changed.
changestringlike,unlikeorsync.kindstring|nulltrack,albumorartist; null forsync.idnumber|nullIts ID; null forsync.likesObject[]Every like, newest first, each{ kind, id, at }.
apiObjectwindow.riff.
More Information
Usage
wp.hooks.addAction( 'riff.like', 'my-plugin', ( detail, api ) => {
} );
// Or, without wp-hooks:
window.riff.on( 'like', ( detail ) => {} );Source
emit( 'like', { change, kind, id, likes: api.likes() } );plugins/riff/assets/riff.jsView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.20.0 | Introduced. |