Automattic\WooCommerce\Internal\Admin
Loader::update_admin_title
Edits Admin title based on section of wc-admin.
Method of the class: Loader{}
No Hooks.
Returns
null. Nothing (null).
Usage
$result = Loader::update_admin_title( $admin_title );
- $admin_title(string) (required)
- Modifies admin title.
Loader::update_admin_title() Loader::update admin title code WC 10.3.6
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' ) );
}