Automattic\WooCommerce\Internal\Admin

Loader::update_admin_title()public staticWC 1.0

Edits Admin title based on section of wc-admin.

Method of the class: Loader{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = Loader::update_admin_title( $admin_title );
$admin_title(string) (required)
Modifies admin title.

Loader::update_admin_title() code WC 8.7.0

public static function update_admin_title( $admin_title ) {
	if (
		! did_action( 'current_screen' ) ||
		! PageController::is_admin_page()
	) {
		return $admin_title;
	}

	$sections = self::get_embed_breadcrumbs();
	$pieces   = array();

	foreach ( $sections as $section ) {
		$pieces[] = is_array( $section ) ? $section[1] : $section;
	}

	$pieces = array_reverse( $pieces );
	$title  = implode( ' ‹ ', $pieces );

	/* translators: %1$s: updated title, %2$s: blog info name */
	return sprintf( __( '%1$s ‹ %2$s', 'woocommerce' ), $title, get_bloginfo( 'name' ) );
}