How to use IF Statement in WordPress?
Here you go.. add_action( ‘gform_after_update_entry_7’, ‘add_length_on_update’, 10, 2 ); function add_length_on_update( $form, $entry_id ) { if( !empty($_POST[“input_3”]) && !empty($_POST[“input_27”]) && !empty($_POST[“input_28”]) ){ // get input from form $date = $_POST[“input_3”]; $start = $_POST[“input_27”]; $end = $_POST[“input_28”]; // convert date and time arrays into datetime formats $startdate = DateTime::createFromFormat(‘m/d/Y@h:i a’, $date . “@”. $start[0].”:”.$start[1].” “.$start[2]); $enddate … Read more