Skip to content
Docs
Get RestroPress

Filter

rpress_customer_tabs

Updated
On this page

Filters the tab definitions for the customer detail screen.

Returns the tab array from rpress_customer_tabs(). Each entry is keyed by a view slug and holds dashicon and title. The defaults (Profile, Orders, Notes, Tools) are added at priority 1 and a Delete tab at the maximum priority so it stays last.

Parameters#

ParameterTypeDescription
$tabsarrayTab definitions keyed by view slug, each an array with 'dashicon' and 'title'.

Return value#

array. The tab definitions.

Example#

function my_customer_tabs( $tabs ) {
	$tabs['loyalty'] = array(
		'dashicon' => 'dashicons-star-filled',
		'title'    => esc_html__( 'Loyalty', 'my-plugin' ),
	);
	return $tabs;
}
add_filter( 'rpress_customer_tabs', 'my_customer_tabs' );

Notes#

The current customer screen does not call rpress_customer_tabs(), so tabs registered here are not rendered by core. Register the view with rpress_customer_views as well.

Source#

Applied in:

  • includes/admin/customers/customers.php (line 59), in rpress_customer_tabs()

See also#

Was this page helpful?