Skip to content

Commit 493c07b

Browse files
remove schema 04 causing validation issues
1 parent bbd8437 commit 493c07b

1 file changed

Lines changed: 8 additions & 15 deletions

File tree

src/wp-includes/abilities/class-wp-settings-abilities.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,16 @@ private static function build_output_schema(): array {
170170
$setting_schema['default'] = $args['default'];
171171
}
172172

173-
if ( is_array( $args['show_in_rest'] ) && ! empty( $args['show_in_rest']['schema'] ) ) {
174-
$setting_schema = array_merge( $setting_schema, $args['show_in_rest']['schema'] );
175-
}
176-
177173
if ( ! isset( $group_properties[ $group ] ) ) {
178174
$group_properties[ $group ] = array(
179-
'type' => 'object',
180-
'description' => sprintf(
175+
'type' => 'object',
176+
'description' => sprintf(
181177
/* translators: %s: Settings group name. */
182178
__( '%s settings.' ),
183179
ucfirst( $group )
184180
),
185-
'properties' => array(),
181+
'properties' => array(),
182+
'additionalProperties' => false,
186183
);
187184
}
188185

@@ -192,9 +189,10 @@ private static function build_output_schema(): array {
192189
ksort( $group_properties );
193190

194191
return array(
195-
'type' => 'object',
196-
'description' => __( 'Settings grouped by registration group. Each group contains settings with their current values.' ),
197-
'properties' => $group_properties,
192+
'type' => 'object',
193+
'description' => __( 'Settings grouped by registration group. Each group contains settings with their current values.' ),
194+
'properties' => $group_properties,
195+
'additionalProperties' => false,
198196
);
199197
}
200198

@@ -229,11 +227,6 @@ private static function register_get_settings(): void {
229227
),
230228
),
231229
),
232-
'oneOf' => array(
233-
array( 'required' => array( 'group' ) ),
234-
array( 'required' => array( 'slugs' ) ),
235-
array( 'maxProperties' => 0 ),
236-
),
237230
'additionalProperties' => false,
238231
'default' => array(),
239232
),

0 commit comments

Comments
 (0)