apply_filters( 'riff_app_views', array $views )

Filters the Listen app's views: Riff's own, by slug (home, search, albums, artists, tracks, posts and library), and any a plugin adds.

Parameters

$viewsarray
The views by slug, Riff's own first.

More Information

A plugin adds a view under a slug of its own, lowercase letters, digits and dashes, with a label and a render callback, and Riff serves it at the app's address with ?riff_view=<slug>, the Listen page's own or, where the site opens the app at its address, the site's. Riff draws the view's title and the panel around what render returns, and once the view shows, on arrival or after in-page navigation, fires the riff.app_view action and the riff:app_view event on document, for the plugin's script to bind to what it drew.

A view of a plugin's is an array with a label, its name in the navigation; title, its heading, the label by default; icon, one of Riff's icons by name or SVG markup from the plugin's own code; nav, where it is listed, sidebar (beside Albums, Artists and Tracks, a chip on a phone) and or account (the account menu), sidebar by default; capability, what a visitor needs to see it at all, none by default; render, given the app's address and returning the panel's HTML, escaped by the plugin; and script, style and module, handles of the plugin's registered scripts, styles and script modules, which Riff enqueues on the page that holds the app.

Unsetting albums, artists, tracks or posts takes it out of the app: out of the navigation, out of Home's rows, and its address opens Home. Home, Search and Library stay.

Usage

add_filter( 'riff_app_views', function ( $views ) {
	return $views;
} );

Source

$filtered = apply_filters( 'riff_app_views', $own );

Changelog

VersionDescription
6.4.0Introduced.