Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Forminator] - Override CSV Export. In this override we replace `fpassthru` with `stream_get_contents`
<?php
/**
* Plugin Name: [Forminator] - Override CSV Export
* Plugin URI: https://premium.wpmudev.org/
* Description: In this override we replace `fpassthru` with `stream_get_contents`
* Author: Panos Lyrakis @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'WPMUDEV_Frominator_Override_CSV_Export' ) ) {
class WPMUDEV_Frominator_Override_CSV_Export {
private static $_instance = null;
private static $form_registered_addons = array();
public static function get_instance() {
if( is_null( self::$_instance ) ){
self::$_instance = new WPMUDEV_Frominator_Override_CSV_Export();
}
return self::$_instance;
}
private function __construct() {
add_action( 'wp_loaded', array( $this, 'listen_for_csv_export' ), 9 );
}
public function listen_for_csv_export() {
if ( ! isset( $_POST['forminator_export'] ) ) {
return;
}
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
if ( ! wp_verify_nonce( $_POST['_forminator_nonce'], 'forminator_export' ) ) {
return;
}
$form_id = isset( $_POST['form_id'] ) ? $_POST['form_id'] : 0;
$type = isset( $_POST['form_type'] ) ? $_POST['form_type'] : null;
$form_id = intval( $form_id );
$export_data = $this->_prepare_export_data( $form_id, $type );
if ( ! $export_data instanceof Forminator_Export_Result ) {
return;
}
$data = $export_data->data;
$model = $export_data->model;
$count = $export_data->entries_count;
//save the time for later uses
$logs = get_option( 'forminator_exporter_log', array() );
if ( ! isset( $logs[ $model->id ] ) ) {
$logs[ $model->id ] = array();
}
$logs[ $model->id ][] = array(
'time' => current_time( 'timestamp' ),
'count' => $count,
);
update_option( 'forminator_exporter_log', $logs );
$fp = fopen( 'php://memory', 'w' ); // phpcs:disable WordPress.WP.AlternativeFunctions.file_system_read_fopen -- disable phpcs because it writes memory\
foreach ( $data as $fields ) {
$fields = Forminator_Export::get_formatted_csv_fields( $fields );
fputcsv( $fp, $fields );
}
$filename = 'forminator-' . sanitize_title( $model->name ) . '-' . date( 'ymdHis' ) . '.csv';
fseek( $fp, 0 );
header( 'Content-Encoding: UTF-8' );
header( 'Content-type: text/csv; charset=UTF-8' );
header( 'Content-Disposition: attachment; filename="' . $filename . '";' );
// print BOM Char for Excel Compatible
echo chr( 239 ) . chr( 187 ) . chr( 191 );// wpcs xss ok. excel generated content
// make php send the generated csv lines to the browser
//fpassthru( $fp );
stream_get_contents( $fp );
exit();
}
private function _prepare_export_data( $form_id, $type, $latest_exported_entry_id = 0 ) {
$model = null;
$data = array();
$entries = array();
$export_result = new Forminator_Export_Result();
$export_result->form_type = $type;
switch ( $type ) {
case 'quiz':
$model = Forminator_Quiz_Form_Model::model()->load( $form_id );
if ( ! is_object( $model ) ) {
return null;
}
$export_result->model = $model;
$entries = Forminator_Form_Entry_Model::get_entries( $form_id );
$headers = array(
__( 'Date', Forminator::DOMAIN ),
__( 'Question', Forminator::DOMAIN ),
__( 'Answer', Forminator::DOMAIN ),
__( 'Result', Forminator::DOMAIN ),
);
$addon_header = $this->attach_quiz_addons_on_export_render_title_row( $form_id, $entries );
$headers = array_merge( $headers, $addon_header );
foreach ( $entries as $entry ) {
if ( $entry->entry_id > $latest_exported_entry_id ) {
$export_result->new_entries_count ++;
}
if ( 'nowrong' === $model->quiz_type ) {
$meta = $entry->meta_data['entry']['value'][0]['value'];
if ( isset( $meta['answers'] ) ) {
foreach ( $meta['answers'] as $answer ) {
$row = array();
$row[] = $entry->time_created;
$row[] = $answer['question'];
$row[] = $answer['answer'];
$row[] = $meta['result']['title'];
$addon_data = $this->attach_quiz_addons_on_export_render_entry_row( $form_id, $entry );
foreach ( $addon_header as $header_id => $item ) {
if ( isset( $addon_data[ $header_id ] ) ) {
$row[] = $addon_data[ $header_id ];
}
}
$data[] = $row;
}
}
} elseif ( 'knowledge' === $model->quiz_type ) {
$meta = $entry->meta_data['entry']['value'];
foreach ( $meta as $answer ) {
$row = array();
$row[] = $entry->time_created;
$row[] = $answer['question'];
$row[] = $answer['answer'];
$row[] = ( ( $answer['isCorrect'] ) ? __( 'Correct', Forminator::DOMAIN ) : __( 'Incorrect', Forminator::DOMAIN ) );
$addon_data = $this->attach_quiz_addons_on_export_render_entry_row( $form_id, $entry );
foreach ( $addon_header as $header_id => $item ) {
if ( isset( $addon_data[ $header_id ] ) ) {
$row[] = $addon_data[ $header_id ];
}
}
$data[] = $row;
}
}
}
$data = array_merge( array( $headers ), $data );
$export_result->data = $data;
break;
case 'poll':
$model = Forminator_Poll_Form_Model::model()->load( $form_id );
if ( ! is_object( $model ) ) {
return null;
}
$export_result->model = $model;
$entries = Forminator_Form_Entry_Model::get_entries( $form_id );
foreach ( $entries as $entry ) {
if ( $entry->entry_id > $latest_exported_entry_id ) {
$export_result->new_entries_count ++;
}
}
$fields_array = $model->get_fields_as_array();
$map_entries = Forminator_Form_Entry_Model::map_polls_entries_for_export( $form_id, $fields_array );
$header = array(
__( 'Date', Forminator::DOMAIN ),
__( 'Answer', Forminator::DOMAIN ),
__( 'Extra', Forminator::DOMAIN ),
);
$addon_header = $this->attach_poll_addons_on_export_render_title_row( $form_id, $entries );
$header = array_merge( $header, $addon_header );
$data = array();
$data[] = $header;
foreach ( $map_entries as $map_entry ) {
$label = $map_entry['meta_value'];
$entry = new Forminator_Form_Entry_Model( $map_entry['entry_id'] );
$extra = $entry->get_meta( 'extra', null );
$row = array(
$entry->time_created,
$label,
$extra,
);
$addon_data = $this->attach_poll_addons_on_export_render_entry_row( $form_id, $entry );
foreach ( $addon_header as $header_id => $item ) {
if ( isset( $addon_data[ $header_id ] ) ) {
$row[] = $addon_data[ $header_id ];
}
}
$data[] = $row;
}
$export_result->data = $data;
break;
case 'cform':
$model = Forminator_Custom_Form_Model::model()->load( $form_id );
if ( ! is_object( $model ) ) {
return null;
}
$entries = Forminator_Form_Entry_Model::get_entries( $form_id );
$mappers = $this->get_custom_form_export_mappers( $model );
$addon_mappers = $this->attach_form_addons_on_export_render_title_row( $form_id, $entries );
$export_result->model = $model;
$result = array();
foreach ( $entries as $entry ) {
if ( $entry->entry_id > $latest_exported_entry_id ) {
$export_result->new_entries_count ++;
}
$data = array();
// traverse from fields to be correctly mapped with updated form fields.
foreach ( $mappers as $mapper ) {
//its from model's property
if ( isset( $mapper['property'] ) ) {
if ( property_exists( $entry, $mapper['property'] ) ) {
$property = $mapper['property'];
// casting property to string
$data[] = (string) $entry->$property;
} else {
$data[] = '';
}
} else {
// meta_key based
$meta_value = $entry->get_meta( $mapper['meta_key'], '' );
if ( ! isset( $mapper['sub_metas'] ) ) {
$data[] = Forminator_Form_Entry_Model::meta_value_to_string( $mapper['type'], $meta_value );
} else {
// sub_metas available
foreach ( $mapper['sub_metas'] as $sub_meta ) {
$sub_key = $sub_meta['key'];
if ( isset( $meta_value[ $sub_key ] ) && ! empty( $meta_value[ $sub_key ] ) ) {
$value = $meta_value[ $sub_key ];
$field_type = $mapper['type'] . '.' . $sub_key;
$data[] = Forminator_Form_Entry_Model::meta_value_to_string( $field_type, $value );
} else {
$data[] = '';
}
}
}
}
}
// Addon columns
$addon_data = $this->attach_form_addons_on_export_render_entry_row( $form_id, $entry );
foreach ( $addon_mappers as $mapper_id => $mapper ) {
if ( isset( $addon_data[ $mapper_id ] ) ) {
$data[] = $addon_data[ $mapper_id ];
}
}
$result[ (string) $entry->entry_id ] = $data;
}
//flatten mappers to headers
$headers = array();
foreach ( $mappers as $mapper ) {
if ( ! isset( $mapper['sub_metas'] ) ) {
$headers[] = $mapper['label'];
} else {
foreach ( $mapper['sub_metas'] as $sub_meta ) {
$headers[] = $sub_meta['label'];
}
}
}
//additional addon headers
foreach ( $addon_mappers as $mapper ) {
$headers[] = $mapper;
}
$data = array_merge( array( 'headers' => $headers ), $result );
$export_result->data = $data;
break;
default:
break;
}
$export_result->entries_count = count( $entries );
// DESC order, latest entry will be first
if ( isset( $entries[0] ) && $entries[0] instanceof Forminator_Form_Entry_Model ) {
$latest_entry = $entries[0];
$export_result->latest_entry_id = $latest_entry->entry_id;
}
return $export_result;
}
private function attach_quiz_addons_on_export_render_title_row( $quiz_id, $entries = array() ) {
$additional_headers = array();
//find all registered addons, so history can be shown even for deactivated addons
$registered_addons = $this->get_quiz_registered_addons( $quiz_id, $entries );
foreach ( $registered_addons as $registered_addon ) {
try {
$quiz_hooks = $registered_addon->get_addon_quiz_hooks( $quiz_id );
$addon_headers = $quiz_hooks->on_export_render_title_row();
$addon_headers = $this->format_addon_additional_headers( $registered_addon, $addon_headers );
$additional_headers = array_merge( $additional_headers, $addon_headers );
} catch ( Exception $e ) {
forminator_addon_maybe_log( $registered_addon->get_slug(), 'failed to attach_quiz_addons_on_export_render_title_row', $e->getMessage() );
}
}
return $additional_headers;
}
private function attach_quiz_addons_on_export_render_entry_row( $form_id, Forminator_Form_Entry_Model $entry_model ) {
$additional_data = array();
//find all registered addons, so history can be shown even for deactivated addons
$registered_addons = $this->get_quiz_registered_addons( $form_id );
foreach ( $registered_addons as $registered_addon ) {
try {
$quiz_hooks = $registered_addon->get_addon_quiz_hooks( $form_id );
$meta_data = forminator_find_addon_meta_data_from_entry_model( $registered_addon, $entry_model );
$addon_data = $quiz_hooks->on_export_render_entry( $entry_model, $meta_data );
$addon_data = $this->format_addon_additional_data( $registered_addon, $addon_data );
$additional_data = array_merge( $additional_data, $addon_data );
} catch ( Exception $e ) {
forminator_addon_maybe_log( $registered_addon->get_slug(), 'failed to attach_quiz_addons_on_export_render_entry_row', $e->getMessage() );
}
}
return $additional_data;
}
private function attach_poll_addons_on_export_render_title_row( $poll_id, $entries = array() ) {
$additional_headers = array();
//find all registered addons, so history can be shown even for deactivated addons
$registered_addons = $this->get_poll_registered_addons( $poll_id, $entries );
foreach ( $registered_addons as $registered_addon ) {
try {
$poll_hooks = $registered_addon->get_addon_poll_hooks( $poll_id );
$addon_headers = $poll_hooks->on_export_render_title_row();
$addon_headers = $this->format_addon_additional_headers( $registered_addon, $addon_headers );
$additional_headers = array_merge( $additional_headers, $addon_headers );
} catch ( Exception $e ) {
forminator_addon_maybe_log( $registered_addon->get_slug(), 'failed to attach_poll_addons_on_export_render_title_row', $e->getMessage() );
}
}
return $additional_headers;
}
private function attach_poll_addons_on_export_render_entry_row( $form_id, Forminator_Form_Entry_Model $entry_model ) {
$additional_data = array();
//find all registered addons, so history can be shown even for deactivated addons
$registered_addons = $this->get_poll_registered_addons( $form_id );
foreach ( $registered_addons as $registered_addon ) {
try {
$poll_hooks = $registered_addon->get_addon_poll_hooks( $form_id );
$meta_data = forminator_find_addon_meta_data_from_entry_model( $registered_addon, $entry_model );
$addon_data = $poll_hooks->on_export_render_entry( $entry_model, $meta_data );
$addon_data = $this->format_addon_additional_data( $registered_addon, $addon_data );
$additional_data = array_merge( $additional_data, $addon_data );
} catch ( Exception $e ) {
forminator_addon_maybe_log( $registered_addon->get_slug(), 'failed to attach_poll_addons_on_export_render_entry_row', $e->getMessage() );
}
}
return $additional_data;
}
private function get_custom_form_export_mappers( $model ) {
/** @var Forminator_Custom_Form_Model $model */
$fields = $model->get_fields();
$ignored_field_types = Forminator_Form_Entry_Model::ignored_fields();
/** @var Forminator_Form_Field_Model $fields */
$mappers = array(
array(
// read form model's property
'property' => 'time_created', // must be on export
'label' => __( 'Submission Time', Forminator::DOMAIN ),
'type' => 'entry_time_created',
),
);
foreach ( $fields as $field ) {
$field_type = $field->__get( 'type' );
if ( in_array( $field_type, $ignored_field_types, true ) ) {
continue;
}
// base mapper for every field
$mapper = array();
$mapper['meta_key'] = $field->slug;
$mapper['label'] = $field->get_label_for_entry();
$mapper['type'] = $field_type;
// fields that should be displayed as multi column (sub_metas)
if ( 'name' === $field_type ) {
$is_multiple_name = filter_var( $field->__get( 'multiple_name' ), FILTER_VALIDATE_BOOLEAN );
if ( $is_multiple_name ) {
$prefix_enabled = filter_var( $field->__get( 'prefix' ), FILTER_VALIDATE_BOOLEAN );
$first_name_enabled = filter_var( $field->__get( 'fname' ), FILTER_VALIDATE_BOOLEAN );
$middle_name_enabled = filter_var( $field->__get( 'mname' ), FILTER_VALIDATE_BOOLEAN );
$last_name_enabled = filter_var( $field->__get( 'lname' ), FILTER_VALIDATE_BOOLEAN );
// at least one sub field enabled
if ( $prefix_enabled || $first_name_enabled || $middle_name_enabled || $last_name_enabled ) {
// sub metas
$mapper['sub_metas'] = array();
if ( $prefix_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'prefix' );
$label = $field->__get( 'prefix_label' );
$mapper['sub_metas'][] = array(
'key' => 'prefix',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
if ( $first_name_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'first-name' );
$label = $field->__get( 'fname_label' );
$mapper['sub_metas'][] = array(
'key' => 'first-name',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
if ( $middle_name_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'middle-name' );
$label = $field->__get( 'mname_label' );
$mapper['sub_metas'][] = array(
'key' => 'middle-name',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
if ( $last_name_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'last-name' );
$label = $field->__get( 'lname_label' );
$mapper['sub_metas'][] = array(
'key' => 'last-name',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
} else {
// if no subfield enabled when multiple name remove mapper (means dont show it on export)
$mapper = array();
}
}
} elseif ( 'address' === $field_type ) {
$street_enabled = filter_var( $field->__get( 'street_address' ), FILTER_VALIDATE_BOOLEAN );
$line_enabled = filter_var( $field->__get( 'address_line' ), FILTER_VALIDATE_BOOLEAN );
$city_enabled = filter_var( $field->__get( 'address_city' ), FILTER_VALIDATE_BOOLEAN );
$state_enabled = filter_var( $field->__get( 'address_state' ), FILTER_VALIDATE_BOOLEAN );
$zip_enabled = filter_var( $field->__get( 'address_zip' ), FILTER_VALIDATE_BOOLEAN );
$country_enabled = filter_var( $field->__get( 'address_country' ), FILTER_VALIDATE_BOOLEAN );
if ( $street_enabled || $line_enabled || $city_enabled || $state_enabled || $zip_enabled || $country_enabled ) {
$mapper['sub_metas'] = array();
if ( $street_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'street_address' );
$label = $field->__get( 'street_address_label' );
$mapper['sub_metas'][] = array(
'key' => 'street_address',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
if ( $line_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'address_line' );
$label = $field->__get( 'address_line_label' );
$mapper['sub_metas'][] = array(
'key' => 'address_line',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
if ( $city_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'city' );
$label = $field->__get( 'address_city_label' );
$mapper['sub_metas'][] = array(
'key' => 'city',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
if ( $state_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'state' );
$label = $field->__get( 'address_state_label' );
$mapper['sub_metas'][] = array(
'key' => 'state',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
if ( $zip_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'zip' );
$label = $field->__get( 'address_zip_label' );
$mapper['sub_metas'][] = array(
'key' => 'zip',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
if ( $country_enabled ) {
$default_label = Forminator_Form_Entry_Model::translate_suffix( 'country' );
$label = $field->__get( 'address_country_label' );
$mapper['sub_metas'][] = array(
'key' => 'country',
'label' => $mapper['label'] . ' - ' . ( $label ? $label : $default_label ),
);
}
} else {
// if no subfield enabled when multiple name remove mapper (means dont show it on export)
$mapper = array();
}
} elseif ( 'stripe' === $field_type || 'paypal' === $field_type ) {
$mapper['sub_metas'] = array();
$mapper['sub_metas'][] = array(
'key' => 'mode',
'label' => $mapper['label'] . ' - ' . __( 'Mode', Forminator::DOMAIN ),
);
$mapper['sub_metas'][] = array(
'key' => 'status',
'label' => $mapper['label'] . ' - ' . __( 'Status', Forminator::DOMAIN ),
);
$mapper['sub_metas'][] = array(
'key' => 'amount',
'label' => $mapper['label'] . ' - ' . __( 'Amount', Forminator::DOMAIN ),
);
$mapper['sub_metas'][] = array(
'key' => 'currency',
'label' => $mapper['label'] . ' - ' . __( 'Currency', Forminator::DOMAIN ),
);
$mapper['sub_metas'][] = array(
'key' => 'transaction_id',
'label' => $mapper['label'] . ' - ' . __( 'Transaction ID', Forminator::DOMAIN ),
);
}
if ( ! empty( $mapper ) ) {
$mappers[] = $mapper;
}
}
/**
* Filter column mappers to be used on export custom form
*
* @since 1.6.3
*
* @param array $mappers
* @param int $form_id
* @param Forminator_Custom_Form_Model $model
*
* @return array
*/
$mappers = apply_filters( 'forminator_custom_form_export_mappers', $mappers, $model->id, $model );
return $mappers;
}
private function attach_form_addons_on_export_render_title_row( $form_id, $entries = array() ) {
$additional_headers = array();
//find all registered addons, so history can be shown even for deactivated addons
$registered_addons = $this->get_form_registered_addons( $form_id, $entries );
foreach ( $registered_addons as $registered_addon ) {
try {
$form_hooks = $registered_addon->get_addon_form_hooks( $form_id );
$addon_headers = $form_hooks->on_export_render_title_row();
$addon_headers = $this->format_addon_additional_headers( $registered_addon, $addon_headers );
$additional_headers = array_merge( $additional_headers, $addon_headers );
} catch ( Exception $e ) {
forminator_addon_maybe_log( $registered_addon->get_slug(), 'failed to on_export_render_title_row', $e->getMessage() );
}
}
return $additional_headers;
}
private function attach_form_addons_on_export_render_entry_row( $form_id, Forminator_Form_Entry_Model $entry_model ) {
$additional_data = array();
//find all registered addons, so history can be shown even for deactivated addons
$registered_addons = $this->get_form_registered_addons( $form_id );
foreach ( $registered_addons as $registered_addon ) {
try {
$form_hooks = $registered_addon->get_addon_form_hooks( $form_id );
$meta_data = forminator_find_addon_meta_data_from_entry_model( $registered_addon, $entry_model );
$addon_data = $form_hooks->on_export_render_entry( $entry_model, $meta_data );
$addon_data = $this->format_addon_additional_data( $registered_addon, $addon_data );
$additional_data = array_merge( $additional_data, $addon_data );
} catch ( Exception $e ) {
forminator_addon_maybe_log( $registered_addon->get_slug(), 'failed to on_export_render_entry', $e->getMessage() );
}
}
return $additional_data;
}
private function format_addon_additional_headers( Forminator_Addon_Abstract $addon, $addon_headers ) {
$formatted_headers = array();
if ( ! is_array( $addon_headers ) || empty( $addon_headers ) ) {
return $formatted_headers;
}
foreach ( $addon_headers as $title_id => $title ) {
if ( ! is_scalar( $title ) || empty( $title ) ) {
continue; // skip on empty title
}
// avoid collistion with other addon ids
$title_id = 'forminator_addon_export_title_' . $addon->get_slug() . '_' . $title_id;
$formatted_headers[ $title_id ] = $title;
}
return $formatted_headers;
}
private function format_addon_additional_data( Forminator_Addon_Abstract $addon, $addon_data ) {
$formatted_data = array();
if ( ! is_array( $addon_data ) || empty( $addon_data ) ) {
return $formatted_data;
}
foreach ( $addon_data as $title_id => $value ) {
$value = Forminator_Form_Entry_Model::meta_value_to_string( 'addon_' . $addon->get_slug(), $value );
// avoid collistion with other addon ids
$title_id = 'forminator_addon_export_title_' . $addon->get_slug() . '_' . $title_id;
$formatted_data[ $title_id ] = $value;
}
return $formatted_data;
}
public function get_form_registered_addons( $form_id, $entries = array() ) {
if ( empty( self::$form_registered_addons ) ) {
self::$form_registered_addons = array();
$registered_addons = forminator_get_registered_addons();
foreach ( $entries as $entry ) {
// find registered addon by slug pattern
$entry_addon_slugs = forminator_find_addon_slugs_from_entry_model( $entry );
foreach ( $entry_addon_slugs as $entry_addon_slug ) {
// check if this slug globally registered
if ( in_array( $entry_addon_slug, array_keys( $registered_addons ), true ) ) {
// check if already in static $registered_addons
if ( ! in_array( $entry_addon_slug, array_keys( self::$form_registered_addons ), true ) ) {
$addon = forminator_get_addon( $entry_addon_slug );
if ( $addon instanceof Forminator_Addon_Abstract ) {
try {
$form_hooks = $addon->get_addon_form_hooks( $form_id );
if ( $form_hooks instanceof Forminator_Addon_Form_Hooks_Abstract ) {
self::$form_registered_addons[ $addon->get_slug() ] = $addon;
}
} catch ( Exception $e ) {
forminator_addon_maybe_log( $addon->get_slug(), 'failed to get_addon_form_hooks one export', $e->getMessage() );
}
}
}
}
}
}
}
return self::$form_registered_addons;
}
}
if ( ! function_exists( 'wpmudev_forminator_override_csv_export' ) ) {
function wpmudev_forminator_override_csv_export() {
return WPMUDEV_Frominator_Override_CSV_Export::get_instance();
};
add_action( 'plugins_loaded', 'wpmudev_forminator_override_csv_export', 10 );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.