From fd205f6384bdbb1f63858da2cdab530b79af1b86 Mon Sep 17 00:00:00 2001 From: pronob1010 Date: Fri, 13 Dec 2024 17:15:30 +0600 Subject: [PATCH 1/2] fix: args updated --- includes/REST/StoreSettingControllerV2.php | 37 +++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/includes/REST/StoreSettingControllerV2.php b/includes/REST/StoreSettingControllerV2.php index 1c1c823b83..c74cdd227e 100644 --- a/includes/REST/StoreSettingControllerV2.php +++ b/includes/REST/StoreSettingControllerV2.php @@ -50,7 +50,13 @@ public function register_routes() { 'methods' => WP_REST_Server::READABLE, 'callback' => [ $this, 'get_settings_group' ], 'permission_callback' => [ $this, 'get_settings_permission_callback' ], - 'args' => [], + 'args' => [ + 'group_id' => [ + 'description' => __( 'Unique identifier for the settings group.', 'dokan' ), + 'type' => 'string', + 'required' => true, + ], + ], ], [ 'methods' => WP_REST_Server::EDITABLE, @@ -68,6 +74,18 @@ public function register_routes() { 'methods' => WP_REST_Server::READABLE, 'callback' => [ $this, 'get_single_settings' ], 'permission_callback' => [ $this, 'get_settings_permission_callback' ], + 'args' => [ + 'group_id' => [ + 'description' => __( 'Unique identifier for the settings group.', 'dokan' ), + 'type' => 'string', + 'required' => true, + ], + 'id' => [ + 'description' => __( 'Unique identifier for the setting.', 'dokan' ), + 'type' => 'string', + 'required' => true, + ], + ], ], [ 'methods' => WP_REST_Server::EDITABLE, @@ -85,6 +103,23 @@ public function register_routes() { 'methods' => WP_REST_Server::READABLE, 'callback' => [ $this, 'get_single_settings_field' ], 'permission_callback' => [ $this, 'get_settings_permission_callback' ], + 'args' => [ + 'group_id' => [ + 'description' => __( 'Unique identifier for the settings group.', 'dokan' ), + 'type' => 'string', + 'required' => true, + ], + 'parent_id' => [ + 'description' => __( 'Unique identifier for the parent setting.', 'dokan' ), + 'type' => 'string', + 'required' => true, + ], + 'id' => [ + 'description' => __( 'Unique identifier for the setting field.', 'dokan' ), + 'type' => 'string', + 'required' => true, + ], + ], ], [ 'methods' => WP_REST_Server::EDITABLE, From 3e92c680bdc54232f3cfca00d39833e0d4ea2656 Mon Sep 17 00:00:00 2001 From: pronob1010 Date: Mon, 30 Dec 2024 14:21:47 +0600 Subject: [PATCH 2/2] fix: phpcs issues --- includes/REST/StoreSettingControllerV2.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/REST/StoreSettingControllerV2.php b/includes/REST/StoreSettingControllerV2.php index c74cdd227e..bfa567c17e 100644 --- a/includes/REST/StoreSettingControllerV2.php +++ b/includes/REST/StoreSettingControllerV2.php @@ -52,7 +52,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'get_settings_permission_callback' ], 'args' => [ 'group_id' => [ - 'description' => __( 'Unique identifier for the settings group.', 'dokan' ), + 'description' => __( 'Unique identifier for the settings group.', 'dokan-lite' ), 'type' => 'string', 'required' => true, ], @@ -76,12 +76,12 @@ public function register_routes() { 'permission_callback' => [ $this, 'get_settings_permission_callback' ], 'args' => [ 'group_id' => [ - 'description' => __( 'Unique identifier for the settings group.', 'dokan' ), + 'description' => __( 'Unique identifier for the settings group.', 'dokan-lite' ), 'type' => 'string', 'required' => true, ], 'id' => [ - 'description' => __( 'Unique identifier for the setting.', 'dokan' ), + 'description' => __( 'Unique identifier for the setting.', 'dokan-lite' ), 'type' => 'string', 'required' => true, ], @@ -105,17 +105,17 @@ public function register_routes() { 'permission_callback' => [ $this, 'get_settings_permission_callback' ], 'args' => [ 'group_id' => [ - 'description' => __( 'Unique identifier for the settings group.', 'dokan' ), + 'description' => __( 'Unique identifier for the settings group.', 'dokan-lite' ), 'type' => 'string', 'required' => true, ], 'parent_id' => [ - 'description' => __( 'Unique identifier for the parent setting.', 'dokan' ), + 'description' => __( 'Unique identifier for the parent setting.', 'dokan-lite' ), 'type' => 'string', 'required' => true, ], 'id' => [ - 'description' => __( 'Unique identifier for the setting field.', 'dokan' ), + 'description' => __( 'Unique identifier for the setting field.', 'dokan-lite' ), 'type' => 'string', 'required' => true, ],