Automattic\WooCommerce\Internal\Admin\Orders
PageController::set_page_title
Set the document title for Orders screens to match what it would be with the shop_order CPT.
Method of the class: PageController{}
No Hooks.
Returns
String
. The filtered admin title.
Usage
$PageController = new PageController(); $PageController->set_page_title( $admin_title );
- $admin_title(string) (required)
- The admin screen title before it's filtered.
PageController::set_page_title() PageController::set page title code WC 9.8.5
public function set_page_title( $admin_title ) { if ( ! $this->is_order_screen( $this->order_type ) ) { return $admin_title; } $wp_order_type = get_post_type_object( $this->order_type ); $labels = get_post_type_labels( $wp_order_type ); if ( $this->is_order_screen( $this->order_type, 'list' ) ) { $admin_title = sprintf( // translators: 1: The label for an order type 2: The name of the website. esc_html__( '%1$s ‹ %2$s — WordPress', 'woocommerce' ), esc_html( $labels->name ), esc_html( get_bloginfo( 'name' ) ) ); } elseif ( $this->is_order_screen( $this->order_type, 'edit' ) ) { $admin_title = sprintf( // translators: 1: The label for an order type 2: The title of the order 3: The name of the website. esc_html__( '%1$s #%2$s ‹ %3$s — WordPress', 'woocommerce' ), esc_html( $labels->edit_item ), absint( $this->order->get_id() ), esc_html( get_bloginfo( 'name' ) ) ); } elseif ( $this->is_order_screen( $this->order_type, 'new' ) ) { $admin_title = sprintf( // translators: 1: The label for an order type 2: The name of the website. esc_html__( '%1$s ‹ %2$s — WordPress', 'woocommerce' ), esc_html( $labels->add_new_item ), esc_html( get_bloginfo( 'name' ) ) ); } return $admin_title; }