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

Functions

ugly_form_html()Pro

1 minute to read Updated 1 week ago Needs UglyFields Pro

ugly_form_html( array $args ): string

The same as ugly_form(), but returned instead of printed. Use it when you build a string: inside a shortcode, a block or a template function that returns HTML.

PHP
add_shortcode( 'contact_form', function () {
	return ugly_form_html( array(
		'groups'    => array( 'group_contact' ),
		'post_type' => 'message',
		'who'       => 'anyone',
	) );
} );

Did this article answer your question?