How to assign the form markup to a variable

Created by Phil Kurth, Modified on Fri, 24 Jun, 2022 at 9:44 AM by Phil Kurth

By default, the `advanced_form()` function echos the form markup in place but you may set the `echo` argument to `false` in order to have the function return the markup. e.g;

$form_html = advanced_form( 'FORM_KEY', [ 'echo' => false ] );

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article