Skip to main content

GFExport

Source: export.php:7

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
maybe_export()Process the forms export request.
import_json()Imports forms from a JSON file.
import_form_media()If a form includes images, import them into the WordPress media library.
find_and_replace_media()Iterate through the form meta data to find images that need to be imported.
import_media()Import images into the WordPress media library.
sanitize_forms_json()Removes any extraneous strings from the beginning of the JSON file to be imported.
maybe_process_automated_export()Checks if form ids are provided in query to be automatically exported.
get_entry_export_line()Returns the content to be included in the export for the supplied entry.
ajax_process_export()Handles the export request from the export entries page.
write_file()Appends lines to to the csv file for the given Export ID.
maybe_create_htaccess_file()Creates an .htaccess file in the given path which will disable access to all files on Apache Web Servers.
maybe_create_index_file()Adds an empty index file in the given path if it doesn't exist already.
ajax_download_export()Handles the download request from the export entries page.

Method Reference

maybe_export()

public static function maybe_export()

Process the forms export request.

Source: export.php:14

import_json()

public static function import_json( $forms_json, &$forms=null, $accessible=false )

Imports forms from a JSON file.

Parameters

NameTypeDefaultDescription
$forms_jsonstringThe JSON string containing the forms to import.
&$formsarraynullAn array to store the imported forms.
$accessibleboolfalseControls whether forms are accessible by default. If true, properties that are not set in the specified $forms parameter will be set to an accessible value (i.e. top label). If false, defaults are not guaranteed to be accessible.

Returns

  • array

Source: export.php:115

import_form_media()

public static function import_form_media( $form_ids, $forms )

If a form includes images, import them into the WordPress media library.

Parameters

NameTypeDefaultDescription
$form_ids
$forms

Returns

  • mixed

Since: 2.9

Source: export.php:191

find_and_replace_media()

public static function find_and_replace_media( &$form_meta )

Iterate through the form meta data to find images that need to be imported.

Any meta data with the key of "file_url" will be imported into the WordPress media library.

Parameters

NameTypeDefaultDescription
&$form_meta

Returns

  • mixed

Since: 2.9

Source: export.php:215

import_media()

public static function import_media( $image_url )

Import images into the WordPress media library.

Parameters

NameTypeDefaultDescription
$image_url

Returns

Since: 2.9

Source: export.php:242

sanitize_forms_json()

public static function sanitize_forms_json( $forms_json )

Removes any extraneous strings from the beginning of the JSON file to be imported.

Parameters

NameTypeDefaultDescription
$forms_jsonstringExported form JSON to be sanitized.

Returns

  • string — Sanitized JSON string.

Since: 2.5.16

Source: export.php:312

maybe_process_automated_export()

public static function maybe_process_automated_export()

Checks if form ids are provided in query to be automatically exported.

This method checks the checkboxes of the desired forms and simulates a click on the submit button.

Returns

  • void

Since: 2.6.2

Source: export.php:722

get_entry_export_line()

public static function get_entry_export_line( $entry, $form, $fields, $field_rows, $separator )

Returns the content to be included in the export for the supplied entry.

Parameters

NameTypeDefaultDescription
$entryarrayThe entry being exported.
$formarrayThe form associated with the current entry.
$fieldsarrayThe IDs of the fields to be exported.
$field_rowsarrayAn array of List fields.
$separatorstringThe character to be used as the column separator.

Returns

  • string

Since: 2.4.5.11

Source: export.php:1242

ajax_process_export()

public static function ajax_process_export()

Handles the export request from the export entries page.

Since: 2.0.0

Source: export.php:1414

write_file()

public static function write_file( $lines, $export_id )

Appends lines to to the csv file for the given Export ID.

Parameters

NameTypeDefaultDescription
$linesstring
$export_idstringA unique ID for the export.

Source: export.php:1444

maybe_create_htaccess_file()

public static function maybe_create_htaccess_file( $path )

Creates an .htaccess file in the given path which will disable access to all files on Apache Web Servers.

Parameters

NameTypeDefaultDescription
$path

Since: 2.0.0

Source: export.php:1480

maybe_create_index_file()

public static function maybe_create_index_file( $path )

Adds an empty index file in the given path if it doesn't exist already.

Parameters

NameTypeDefaultDescription
$path

Since: 2.0.0

Source: export.php:1502

ajax_download_export()

public static function ajax_download_export()

Handles the download request from the export entries page.

Since: 2.0.0

Source: export.php:1516