File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
WooCommerce/Classes/Routing Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,15 @@ final class NativeProductDetailCoordinator {
105105
106106final class ProductURLProvider {
107107 func adminURL( for product: Product , site: Site ) -> URL ? {
108- return site. adminURLWithFallback ( ) ? . appendingPathComponent ( " ?page=next-admin&p=/woocommerce/products/edit/ \( product. productID) " )
108+ guard let base = site. adminURLWithFallback ( ) else { return nil }
109+ let admin = base. appendingPathComponent ( " wp-admin " )
110+
111+ var components = URLComponents ( url: admin, resolvingAgainstBaseURL: false ) !
112+ components. queryItems = [
113+ URLQueryItem ( name: " page " , value: " next-admin " ) ,
114+ URLQueryItem ( name: " p " , value: " /woocommerce/products/edit/ \( product. productID) " )
115+ ]
116+
117+ return components. url
109118 }
110119}
You can’t perform that action at this time.
0 commit comments