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

The PHP API

The PHP API

The few functions that read, print, find and save your fields from your theme.

1 minute to read Updated 1 week ago

PHP
ugly_get( 'field' );             // the value, ready to use
ugly_show( 'field' );            // prints it, safe to print
ugly_rows( 'field' );            // the rows of a repeater or flexible content, to loop over
ugly_update( 'field', $value );  // saves it, cleaned like what an editor types
ugly_delete( 'field' );          // deletes it
ugly_find( 'recipe', [ ... ] );  // finds posts by their fields
[ugly-fields field="field"]       // the same as ugly_show(), inside content

In this chapter

Where to go next

You want to… Read
Look up one function Reference: functions
Copy a working recipe Cookbook
Write safe, fast templates Best practices
Understand the safety model Security

Did this article answer your question?