WordPress at a glance
function is not described

before_last_bar() WP 2.8.0

Remove last item on a pipe-delimited string.

Meant for removing the last item in a string, such as 'Role name|User role'. The original string will be returned if no pipe '|' characters are found in the string.

No Hooks.

Return

String. Either $string or everything before the last pipe.

Usage

before_last_bar( $string );
$string(string) (required)
A pipe-delimited string.

Code of before last bar: wp-includes/l10n.php VER 5.1.1

<?php
function before_last_bar( $string ) {
	$last_bar = strrpos( $string, '|' );
	if ( false === $last_bar ) {
		return $string;
	} else {
		return substr( $string, 0, $last_bar );
	}
}