Automattic\WooCommerce\Internal\Admin

Loader::update_admin_title()public staticWC 1.0

Edits Admin title based on section of wc-admin.

Метод класса: Loader{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = Loader::update_admin_title( $admin_title );
$admin_title(строка) (обязательный)
Modifies admin title.

Код Loader::update_admin_title() 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' ) );
}