# Groups and files

Source: https://uglydev.com/docs/hooks-and-filters/groups-and-files/
Updated: 19 November 2026

## `ugly_field_groups`

**Filter.** The list of groups, after loading them. Change, add or remove groups from code.

```php
add_filter( 'ugly_field_groups', function ( array $groups ) {
	// Return the groups you want loaded.
	return $groups;
} );
```

## `ugly_json_paths`

**Filter.** The folders where the JSON files are read. By default, the `ugly-json/` of your theme and of its parent theme.

```php
add_filter( 'ugly_json_paths', function ( array $folders ) {
	$folders[] = WP_CONTENT_DIR . '/shared/ugly-json';
	return $folders;
} );
```

## `ugly_json_save_path`

**Filter.** The folder where groups are written. By default, the first of the folders above.

```php
add_filter( 'ugly_json_save_path', fn ( $path ) => get_stylesheet_directory() . '/ugly-json' );
```
