Skip to content

Instantly share code, notes, and snippets.

@sabrina-zeidan
Created October 15, 2020 16:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sabrina-zeidan/85a8e4b0a6658c9ccbf9a3bc4934605e to your computer and use it in GitHub Desktop.
Save sabrina-zeidan/85a8e4b0a6658c9ccbf9a3bc4934605e to your computer and use it in GitHub Desktop.
ACF form inside a shortcode (buffering) otherwise broken XML sitemaps, headers already sent etc
add_shortcode( 'acf_registration', 'acf_registration' );
function acf_registration() {
$args = array(); //arguments here
ob_start();
acf_form( $args );
$registration_form = ob_get_contents();
ob_end_clean();
return $registration_form;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment