Developers

wp.hooks.doAction( 'riff.playlist', detail, api )

Fires when one of the signed-in listener's playlists is made, changed or deleted.

Also dispatched as the riff:playlist event on #riff, with the same detail. The event bubbles.

Parameters

detailObject
What changed.
  • changestring
    create, add, rename, reorder, remove or delete.
  • playlistObject
    The playlist, { id, title, count }.
  • playlistsObject[]
    Every playlist, the most recently changed first.
apiObject
window.riff.

More Information

Usage

wp.hooks.addAction( 'riff.playlist', 'my-plugin', ( detail, api ) => {
} );

// Or, without wp-hooks:
window.riff.on( 'playlist', ( detail ) => {} );

Source

emit( 'playlist', {
change,
playlist: brief,
playlists: api.playlists(),
} );

Changelog

VersionDescription
4.20.0Introduced.