includes/api/class-wc-rest-orders-controller.php 1 location
|
@@ 367-371 (lines=5) @@
|
| 364 |
|
); |
| 365 |
|
} |
| 366 |
|
|
| 367 |
|
if ( 0 !== (int) $order->post->post_parent ) { |
| 368 |
|
$links['up'] = array( |
| 369 |
|
'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $order->post->post_parent ) ), |
| 370 |
|
); |
| 371 |
|
} |
| 372 |
|
|
| 373 |
|
return $links; |
| 374 |
|
} |
includes/api/class-wc-rest-products-controller.php 1 location
|
@@ 574-578 (lines=5) @@
|
| 571 |
|
$links['up'] = array( |
| 572 |
|
'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->parent ) ), |
| 573 |
|
); |
| 574 |
|
} elseif ( $product->is_type( 'simple' ) && ! empty( $product->post->post_parent ) ) { |
| 575 |
|
$links['up'] = array( |
| 576 |
|
'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->post->post_parent ) ), |
| 577 |
|
); |
| 578 |
|
} |
| 579 |
|
|
| 580 |
|
return $links; |
| 581 |
|
} |