includes/api/class-wc-rest-product-attributes-controller.php 1 location
|
@@ 499-511 (lines=13) @@
|
| 496 |
|
* @param object $attribute Attribute object. |
| 497 |
|
* @return array Links for the given attribute. |
| 498 |
|
*/ |
| 499 |
|
protected function prepare_links( $attribute ) { |
| 500 |
|
$base = '/' . $this->namespace . '/' . $this->rest_base; |
| 501 |
|
$links = array( |
| 502 |
|
'self' => array( |
| 503 |
|
'href' => rest_url( trailingslashit( $base ) . $attribute->attribute_id ), |
| 504 |
|
), |
| 505 |
|
'collection' => array( |
| 506 |
|
'href' => rest_url( $base ), |
| 507 |
|
), |
| 508 |
|
); |
| 509 |
|
|
| 510 |
|
return $links; |
| 511 |
|
} |
| 512 |
|
|
| 513 |
|
/** |
| 514 |
|
* Get the Attribute's schema, conforming to JSON Schema. |
includes/api/class-wc-rest-settings-options-controller.php 1 location
|
@@ 262-274 (lines=13) @@
|
| 259 |
|
* @param string $group_id Group ID. |
| 260 |
|
* @return array Links for the given setting. |
| 261 |
|
*/ |
| 262 |
|
protected function prepare_links( $setting_id, $group_id ) { |
| 263 |
|
$base = '/' . $this->namespace . '/' . $this->rest_base . '/' . $group_id; |
| 264 |
|
$links = array( |
| 265 |
|
'self' => array( |
| 266 |
|
'href' => rest_url( trailingslashit( $base ) . $setting_id ), |
| 267 |
|
), |
| 268 |
|
'collection' => array( |
| 269 |
|
'href' => rest_url( $base ), |
| 270 |
|
), |
| 271 |
|
); |
| 272 |
|
|
| 273 |
|
return $links; |
| 274 |
|
} |
| 275 |
|
|
| 276 |
|
/** |
| 277 |
|
* Makes sure the current user has access to READ the settings APIs. |