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

Code and automation

Writing a value from code

Save a value from code with the same cleaning an editor's value gets.

1 minute Works with the free plugin

PHP
ugly_update( 'price', 120, $post_id );          // a post
ugly_update( 'tagline', 'Hello', 'option' );    // an options page
ugly_update( 'color', '#ff5500', 'term_12' );   // a term
ugly_update( 'bio', 'Chef', 'user_3' );         // a user

ugly_delete( 'price', $post_id );

What you write goes through the same cleaning as what an editor types. A price out of range is cut.