Skip to content
Custom fields for WordPress that are quick to build and quick to load. Get Pro
Docs

Hooks and filters

Groups and files

1 minute to read Updated 1 week ago

On this page

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' );

Did this article answer your question?