Skip to main content

Schema-related filters

These hooks let you adjust schema and UI schema definitions used across admin forms and the Docusaurus docs.

Included hooks

slc_filter_*_schema

Use this hook to modify the various schema definitions.

Arguments

  • $schema: (array) The current schema.

Example

Add a custom property to the schema.

function my_filter_schema( $schema ) {
$schema['properties']['custom_note'] = array(
'type' => 'string',
'title' => 'Custom note',
);

return $schema;
}
add_filter( 'slc_filter_audience_schema', 'my_filter_schema' );

slc_filter_*_uischema

Use this hook to modify the various UI schema definitions.

Arguments

  • $uischema: (array) The current UI schema.

Example

Display a field as a textarea.

function my_filter_uischema( $uischema ) {
$uischema['custom_note'] = array(
'ui:widget' => 'textarea',
);

return $uischema;
}
add_filter( 'slc_filter_audience_uischema', 'my_filter_uischema' );