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
|
@@ 622-626 (lines=5) @@
|
| 619 |
|
$links['up'] = array( |
| 620 |
|
'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->parent ) ), |
| 621 |
|
); |
| 622 |
|
} elseif ( $product->is_type( 'simple' ) && ! empty( $product->post->post_parent ) ) { |
| 623 |
|
$links['up'] = array( |
| 624 |
|
'href' => rest_url( sprintf( '/%s/products/%d', $this->namespace, $product->post->post_parent ) ), |
| 625 |
|
); |
| 626 |
|
} |
| 627 |
|
|
| 628 |
|
return $links; |
| 629 |
|
} |