Duplicating Forms with the GFAPI

Introduction

The GFAPI::duplicate_form() method is used to duplicate forms.

Method Overview

ClassGFAPI
Functionduplicate_form
Parameterssee below
Returnssee below

Source Code

public static function duplicate_form( $form_id ) {}

This method is located in /includes/api.php.

Parameters

ParamTypeDescription
$form_idintegerThe ID of an existing form to be duplicated.

Returns

An integer (the new form ID) or a WP_Error instance if an error occurs.

Usage Example

$result = GFAPI::duplicate_form( $form_id );