PluginProbe
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More / 2.6.1
Content Control – The Ultimate Content Restriction Plugin! Restrict Content, Create Conditional Blocks & More v2.6.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.10 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 All 47 releases
← All changes | classes/RestAPI/Settings.php +4 -28 2.0.122.6.1 View file →
@@ -67,9 +67,9 @@
67 67 public function get_settings() {
68 68 $settings = get_all_plugin_options();
69 69
70 70 if ( $settings ) {
71 - return new WP_REST_Response( $settings, 200 );
71 + return new WP_REST_Response( [ 'settings' => $settings ], 200 );
72 72 } else {
73 73 return new WP_Error( '404', __( 'Something went wrong, the settings could not be found.', 'content-control' ), [ 'status' => 404 ] );
74 74 }
75 75 }
@@ -81,9 +81,9 @@
81 81 *
82 82 * @return \WP_Error|\WP_REST_Response
83 83 */
84 84 public function update_settings( $request ) {
85 - $settings = $request->get_params();
85 + $settings = $request->get_param( 'settings' );
86 86
87 87 $error_message = __( 'Something went wrong, the settings could not be updated.', 'content-control' );
88 88
89 89 if ( ! get_all_plugin_options() ) {
@@ -126,34 +126,10 @@
126 126 '$schema' => 'http://json-schema.org/draft-04/schema#',
127 127 'title' => 'settings',
128 128 'type' => 'object',
129 129 'properties' => [
130 - 'block_controls' => [
131 - 'type' => 'object',
132 - 'properties' => [
133 - 'enable' => [
134 - 'type' => 'boolean',
135 - ],
136 - 'controls' => [
137 - 'type' => 'object',
138 - 'properties' => [
139 - 'device_rules' => [
140 - 'type' => 'object',
141 - 'properties' => [
142 - 'enable' => [
143 - 'type' => 'boolean',
144 - ],
145 - ],
146 - ],
147 - ],
148 - ],
149 - 'disabled_blocks' => [
150 - 'type' => 'array',
151 - 'items' => [
152 - 'type' => 'string',
153 - ],
154 - ],
155 - ],
130 + 'settings' => [
131 + 'type' => 'object',
156 132 ],
157 133 ],
158 134 ]
159 135 );