Fires when a control an extension added through riff_chips or riff_bar_controls is pressed.
Also dispatched as the riff:action event on #riff, with the same detail. The event bubbles.
Parameters
detailObject- What was pressed.
actionstringThe control'saction, as the PHP filter set it.trackObjectThe track playing.buttonHTMLElementThe button that was pressed.
apiObjectwindow.riff.
More Information
Usage
wp.hooks.addAction( 'riff.action', 'my-plugin', ( detail, api ) => {
} );
// Or, without wp-hooks:
window.riff.on( 'action', ( detail ) => {} );Source
emit( 'action', { action, track: track(), button } );plugins/riff/assets/riff.jsView on GitHub
Changelog
| Version | Description |
|---|---|
| 4.0.0 | Introduced. |