et_wishlist_endpoint(); $wishlist_label = __( 'Wishlist', 'woocommerce' ); // Insert the wishlist item before the logout item, or at the end if not present. $logout_pos = array_search( 'customer-logout', array_keys( $items ), true ); if ( false === $logout_pos ) { $items[ $wishlist_endpoint ] = $wishlist_label; } else { $items = array_slice( $items, 0, $logout_pos, true ) + array( $wishlist_endpoint => $wishlist_label ) + array_slice( $items, $logout_pos, null, true ); } return $items; } /** * Wishlist endpoint page title. * * @param string $title Default title. */ public function wishlist_endpoint_title( $title ): string { return __( 'Wishlist', 'woocommerce' ); } /** * Render the wishlist endpoint by dispatching to the * `woocommerce/wishlist` block. The block handles the empty state, * logged-out guard, asset enqueues, and item rendering. */ public function render_wishlist_endpoint(): void { // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- the block string is a static literal; `do_blocks()` invokes the registered block's render callback, which is responsible for its own escaping. echo do_blocks( '' ); } }