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

WP-CLI

check

1 minute to read Updated 1 week ago

Terminal
wp ugly-fields check

Checks every JSON file of your theme the way the builder would. For each file that is not valid, it prints a warning with the key and the reason. If there is at least one, the command ends with an error and exit code 1.

It also warns, without failing, about your blocks:

Warning Meaning
The block has no file that draws it ugly-blocks/<name>/render.php is missing, so the block draws nothing on the site
The block.json has parts UglyFields does not use You wrote keys the screen cannot set. They stay in the file and do nothing
The block has no field group No group has the location Block is
A problem in a block folder For example, the folder is copied twice

The text of each message depends on the problem. An example:

$ wp ugly-fields check
Warning: group_team: A field has a name that is not allowed.
Warning: The block "hero" has no file that draws it (ugly-blocks/hero/render.php).
Error: 1 file(s) have problems.

When everything is fine:

Success: 12 group file(s) are valid.

Did this article answer your question?