Ecommerce Shopify WordPress Discussion

Problem creating wordpress form for custom post type using ACF

I'm trying to display a form on the frontend to register a custom post type with ACF. I also want to make it available only to some types of users. I've already started writing the function in shortcode form to try to pass some parameters when the function is functional, so I believe it will be more practical. The form is being displayed normally, the fields are being sent successfully but I think the validation is not working, because after sending it is directed to a blank page, and the field values are not reset after sending. function acf_form_client_yoo() { if (current_user_can('client-yoo')) { acf_form_head(); if ($_POST && isset($_POST['acf'])) { $fields = $_POST['acf']; if (empty($fields['field_1']) || empty($fields['field_2']) || empty($fields['field_3'])) { } else { acf_form(array( 'post_id' => 'new_post', 'post_title' => true, 'new_post' => array( 'post_type' => 'basic_course', 'post_status' => 'publish' ), 'field_groups' => array('group_65d53cb67bb64'), 'submit_value' => 'Register', 'updated_message' => __("Success", 'acf'), 'return' => 'https://google.com/' )); } } else { acf_form(array( 'post_id' => 'new_post', 'post_title' => true, 'new_post' => array( 'post_type' => 'basic_course', 'post_status' => 'publish' ), 'field_groups' => array('group_65d53cb67bb64'), 'submit_value' => 'Register', 'updated_message' => __("Success", 'acf'), 'return' => 'https://google.com/' )); } } } add_shortcode('acf_form_client_yoo', 'acf_form_client_yoo'); I need the ACF form created on the front to send the information with validation and return to the form page with the fields reset.
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.