wp-content/plugins/contact-form-7-multi-step-module/cf7msm.php
/**
 * Hide the second step of a form.  looks at hidden field 'step'.
 * Always show if the form is the first step.
 * If it's not the first step, make sure it's the next form in the steps.
 */
Hide the second step of a form.  looks at hidden field 'step'.
Always show if the form is the first step.
If it's not the first step, make sure it's the next form in the steps.
Hide the second step of a form . looks at hidden field ' step ' . Always show if the form is the first step . If it ' s not the first step make sure it ' s the next form in the steps .
function cf7msm_step_2( $cf7 )
{
    $has_wpcf7_class = class_exists( 'WPCF7_ContactForm' ) && method_exists( $cf7, 'prop' );
    $form_id = '';
    if ( $has_wpcf7_class ) {
        $formstring = $cf7->prop( 'form' );
        $form_id = $cf7->id();
    } else {
        $formstring = $cf7->form;
        $form_id = $cf7->id;
    }
    if ( !is_admin() && (preg_match( '/\\[multistep "(\\d+)-(\\d+)-?(.*)"\\]/', $formstring, $matches ) || preg_match( '/\\[hidden cf7msm-step "(\\d+)-(\\d+)"\\]/', $formstring, $matches )) ) {
        $step = cf7msm_get( 'cf7msm-step' );
        if ( !isset( $matches[1] ) || $matches[1] != 1 && empty($step) || $matches[1] != 1 && (int) $step + 1 < $matches[1] ) {
            if ( $has_wpcf7_class ) {
                $cf7->set_properties( array(
                    'form' => apply_filters( 'wh_hide_cf7_step_message', esc_html( __( 'Please fill out the form on the previous page', 'contact-form-7-multi-step-module' ) ), $form_id ),
                ) );
            } else {
                $cf7->form = apply_filters( 'wh_hide_cf7_step_message', esc_html( __( 'Please fill out the form on the previous page', 'contact-form-7-multi-step-module' ) ), $form_id );
            }
        }
    }
    return $cf7;
}
function cf7msm_step_2 ( $ cf7 ) { $ has_wpcf7_class = class_exists ( 'WPCF7_ContactForm' ) && method_exists ( $ cf7 , 'prop' ) ; $ form_id = '' ; if ( $ has_wpcf7_class ) { $ formstring = $ cf7 -> prop ( 'form' ) ; $ form_id = $ cf7 -> id ( ) ; } else { $ formstring = $ cf7 -> form ; $ form_id = $ cf7 -> id ; } if ( ! is_admin ( ) && ( preg_match ( '/\\[multistep "(\\d+)-(\\d+)-?(.*)"\\]/' , $ formstring , $ matches ) || preg_match ( '/\\[hidden cf7msm-step "(\\d+)-(\\d+)"\\]/' , $ formstring , $ matches ) ) ) { $ step = cf7msm_get ( 'cf7msm-step' ) ; if ( ! isset ( $ matches [ 1 ] ) || $ matches [ 1 ] != 1 && empty ( $ step ) || $ matches [ 1 ] != 1 && ( int ) $ step + 1 < $ matches [ 1 ] ) { if ( $ has_wpcf7_class ) { $ cf7 -> set_properties ( array ( 'form' => apply_filters ( 'wh_hide_cf7_step_message' , esc_html ( __ ( 'Please fill out the form on the previous page' , 'contact-form-7-multi-step-module' ) ) , $ form_id ) , ) ) ; } else { $ cf7 -> form = apply_filters ( 'wh_hide_cf7_step_message' , esc_html ( __ ( 'Please fill out the form on the previous page' , 'contact-form-7-multi-step-module' ) ) , $ form_id ) ; } } } return $ cf7 ; }
Hide the second step of a form.
Hide the second step of a form .
//check if form has a step field