Home › Forums › Front-end Issues › Detecting unsaved data › Reply To: Detecting unsaved data
This is the code for one of my forms. Each form has its own shortcode
add_shortcode( 'ibsc_scp_stage2', 'scp_stage2' );
function scp_stage2() {
//retrieve scp-id from URL
if ( isset( $_GET['scp-id'] ) ) {
$scp_id = sanitize_text_field( $_GET['scp-id'] );
} //end if
//assemble $form_config array
$form_config = array(
'post_id' => $scp_id,
'new_post' => false,
'post_title' => false,
'form' => true,
'field_groups' => array(), //blank
'fields' => array(
'field_683c1e59136a4', //scp_sch_nam - tx
'field_683c1ed529a74', //scp_pho_typ - tx
), //end of fields array
'submit_value' => __('Update Taxonomies'),
); //end of form_config array
//process acf form
ob_start();
acf_form($form_config);
$ob = ob_get_clean();
return $ob;
} //end function
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.