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

Functions

ugly_show()

1 minute to read Updated 1 week ago

PHP
ugly_show( string $name, int|string|null $target = null ): void

Prints the value of a field, escaped for the place it goes in. A text is escaped as text; a URL as a URL; rich text is cleaned with the same list WordPress uses for posts.

PHP
<h1><?php ugly_show( 'headline' ); ?></h1>
<p><?php ugly_show( 'summary' ); ?></p>

It prints nothing when there is nothing to print, so no if is needed for a simple text.

Did this article answer your question?