includes/api/class-wc-rest-orders-controller.php 1 location
|
@@ 377-381 (lines=5) @@
|
| 374 |
|
); |
| 375 |
|
} |
| 376 |
|
|
| 377 |
|
if ( 0 !== (int) $order->post->post_parent ) { |
| 378 |
|
$links['up'] = array( |
| 379 |
|
'href' => rest_url( sprintf( '/%s/orders/%d', $this->namespace, $order->post->post_parent ) ), |
| 380 |
|
); |
| 381 |
|
} |
| 382 |
|
|
| 383 |
|
return $links; |
| 384 |
|
} |
includes/api/class-wc-rest-products-controller.php 1 location
|
@@ 612-616 (lines=5) @@
|
| 609 |
|
$links['up'] = array( |
| 610 |
|
'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->parent ) ), |
| 611 |
|
); |
| 612 |
|
} elseif ( $product->is_type( 'simple' ) && ! empty( $product->post->post_parent ) ) { |
| 613 |
|
$links['up'] = array( |
| 614 |
|
'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->post->post_parent ) ), |
| 615 |
|
); |
| 616 |
|
} |
| 617 |
|
|
| 618 |
|
return $links; |
| 619 |
|
} |