Developers

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

Fires when a tab beside Now Playing is shown, including Up next. A plugin that added a tab fills its panel here, and again on riff.track while its tab is showing.

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

Parameters

detailObject
What changed.
  • idstring
    The tab's slug.
  • panelHTMLElement
    The tab's panel, [data-riff-panel="<slug>"].
  • trackObject|null
    The track playing.
apiObject
window.riff.

More Information

Usage

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

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

Source

emit( 'tab', {
id,
panel: $( `[data-riff-panel="${ id }"]` ),
track: track() || null,
} );

Changelog

VersionDescription
4.17.0Introduced.