Merge pull request #13759 from woocommerce/fix/rest-api-settings-links

[REST API] Fixed links of settings endpoint
This commit is contained in:
Mike Jolley 2017-03-24 10:33:16 +00:00 committed by GitHub
commit af8e892f97
2 changed files with 6 additions and 9 deletions

View File

@ -97,9 +97,8 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
protected function prepare_links( $group_id ) {
$base = '/' . $this->namespace . '/' . $this->rest_base;
$links = array(
'item' => array(
'href' => rest_url( trailingslashit( $base ) . $group_id ),
'embeddable' => true,
'options' => array(
'href' => rest_url( trailingslashit( $base ) . $group_id ),
),
);

View File

@ -52,10 +52,9 @@ class Settings extends WC_REST_Unit_Test_Case {
'description' => 'My awesome test settings.',
'sub_groups' => array( 'sub-test' ),
'_links' => array(
'item' => array(
'options' => array(
array(
'href' => rest_url( '/wc/v2/settings/test' ),
'embeddable' => true,
'href' => rest_url( '/wc/v2/settings/test' ),
),
),
),
@ -68,10 +67,9 @@ class Settings extends WC_REST_Unit_Test_Case {
'description' => '',
'sub_groups' => array(),
'_links' => array(
'item' => array(
'options' => array(
array(
'href' => rest_url( '/wc/v2/settings/sub-test' ),
'embeddable' => true,
'href' => rest_url( '/wc/v2/settings/sub-test' ),
),
),
),