For developers
Fields you can read, test and deploy
Groups as files in your theme, plain functions, a normal WP_Query back and WP-CLI for your deploys. Nothing hidden behind a cursor or a global.
The whole API fits in your head
Six things to reach for. Each one does what its name says.
-
ugly_get
Read a value, already in the shape you want.
-
ugly_show
Print it, escaped for the type of the field.
-
ugly_find
Posts by fields.
-
ugly_update
Write from code.
-
ugly_form
Forms that save into fields.
-
WP-CLI
check, sync, list, export and import.
Ask for posts the way you would say it.
Easy recipes, under 30 minutes, Italian or French, quickest first: 26 lines of meta_query, or 5 with ugly_find().
In WordPress: 26 lines
$q = new WP_Query( array(
'post_type' => 'recipe',
'posts_per_page' => 12,
'meta_key' => 'minutes',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'difficulty',
'value' => 'easy',
'compare' => '=',
),
array(
'key' => 'minutes',
'value' => 30,
'type' => 'NUMERIC',
'compare' => '<',
),
array(
'key' => 'cuisine',
'value' => array( 'italian', 'french' ),
'compare' => 'IN',
),
),
) );
With UglyFields: 5 lines
$q = ugly_find( 'recipe', array(
'difficulty' => 'easy',
'minutes' => '< 30',
'cuisine' => array( 'italian', 'french' ),
), array( 'order' => 'minutes asc', 'limit' => 12 ) );
It fits the way you already work
Your theme, your Git, your templates.
-
Fields live in your theme
Every group is a JSON file. Review a field change in a pull request, deploy it with the rest of the code.
Fields as fileswp-content/themes/yourtheme/ugly-json/
- { }hero.json Changed in the file
- { }team.json
- { }prices.json
- { }contact.json
-
ugly-blocks/
testimonial/
- block.json
- render.php
- style.css
That is the whole block. No React, no build step.
-
Plain data underneath
Values are standard WordPress custom fields. get_post_meta() reads them, with or without the plugin.
Where values are storedT Headline
TextCode name headline
100% 75% 50% 33% Required
No surprises in your templates.
The boring parts are done the way you would do them.
-
Normal custom fields
Your values are standard post, user, term and option meta.
-
Escaped for the type
ugly_show() prints each field the safe way for what it is.
-
Rows are variables
Pass one to a template part, or loop inside a loop.
-
Readable files
Plain JSON you can diff, grep and review.
Can I keep my field groups in Git?
Yes. Groups, content types and options pages are saved as JSON files in a folder of your theme, so they travel with your code and show up as changes in Git.
Is there a command line?
Yes: wp ugly list, check, sync, export and import. You can use them in a deploy script.
Can I show my values in the REST API or GraphQL?
Yes. Values appear in the REST API in a field called ugly, only for what a visitor may read. If you use WPGraphQL, your fields appear in its schema too.
Can I search posts by their fields?
Yes, with ugly_find(). You ask in the words you would use, like minutes under 30 or price between 5 and 10, and you get a normal WP_Query back.
Yours for good
Get UglyFields Pro
Not renewing never locks you out of building your site. Cancel any time and keep using it.