Home › Forums › Front-end Issues › Use acf_form frontend only, not in backend › Reply To: Use acf_form frontend only, not in backend
Thanks again John! So with your help I put this together and now it works like I want.
add_filter( 'acf/pre_save_post' , function( $post_id ) {
// check if this is to be a new post
if ( $post_id != 'new' ) {
return $post_id;
}
if ( isset( $_POST['add-to-cart'] ) && isset( $_POST['product_id'] ) ) {
unset( $_POST );
}
// return the new ID
return $post_id;
}, 10, 1 );
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.