Developers

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

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.
  • actionstring
    The control's action, as the PHP filter set it.
  • trackObject
    The track playing.
  • buttonHTMLElement
    The button that was pressed.
apiObject
window.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 } );

Changelog

VersionDescription
4.0.0Introduced.