'wpforms', 'post_status' => 'publish', 'post_title' => 'QE Test Form', 'post_content' => '', ]); $formJson = [ 'id' => (string) $formId, 'field_id' => '5', 'fields' => [ '1' => [ 'id' => '1', 'type' => 'text', 'label' => 'Original Name Label', 'placeholder' => 'Original placeholder', 'description' => 'Original description', 'required' => '1', 'size' => 'medium', ], '2' => [ 'id' => '2', 'type' => 'select', 'label' => 'Preferred contact', 'choices' => [ '1' => ['label' => 'Email', 'value' => 'email'], '2' => ['label' => 'Phone', 'value' => 'phone'], ], 'size' => 'medium', ], ], 'settings' => [ 'form_title' => 'QE Test Form', 'form_desc' => '', 'submit_text' => 'Submit', 'submit_text_processing' => 'Sending…', ], ]; wp_update_post([ 'ID' => $formId, 'post_content' => wp_slash(wp_json_encode($formJson)), ]); $content = "\n" . '