Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wpforms-.../src/Admin/Tools
File: Importers.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace WPForms\Admin\Tools;
[2] Fix | Delete
[3] Fix | Delete
use WPForms\Admin\Tools\Importers\ContactForm7;
[4] Fix | Delete
use WPForms\Admin\Tools\Importers\NinjaForms;
[5] Fix | Delete
use WPForms\Admin\Tools\Importers\PirateForms;
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Load the different form importers.
[9] Fix | Delete
*
[10] Fix | Delete
* @since 1.6.6
[11] Fix | Delete
*/
[12] Fix | Delete
class Importers {
[13] Fix | Delete
[14] Fix | Delete
/**
[15] Fix | Delete
* Available importers.
[16] Fix | Delete
*
[17] Fix | Delete
* @since 1.6.6
[18] Fix | Delete
*
[19] Fix | Delete
* @var array
[20] Fix | Delete
*/
[21] Fix | Delete
private $importers = [];
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Load default form importers.
[25] Fix | Delete
*
[26] Fix | Delete
* @since 1.6.6
[27] Fix | Delete
*/
[28] Fix | Delete
public function load() {
[29] Fix | Delete
[30] Fix | Delete
if ( empty( $this->importers ) ) {
[31] Fix | Delete
$this->importers = [
[32] Fix | Delete
'contact-form-7' => new ContactForm7(),
[33] Fix | Delete
'ninja-forms' => new NinjaForms(),
[34] Fix | Delete
'pirate-forms' => new PirateForms(),
[35] Fix | Delete
];
[36] Fix | Delete
}
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
/**
[40] Fix | Delete
* Load default form importers.
[41] Fix | Delete
*
[42] Fix | Delete
* @since 1.6.6
[43] Fix | Delete
*
[44] Fix | Delete
* @return array
[45] Fix | Delete
*/
[46] Fix | Delete
public function get_importers() {
[47] Fix | Delete
[48] Fix | Delete
$this->load();
[49] Fix | Delete
[50] Fix | Delete
$importers = [];
[51] Fix | Delete
[52] Fix | Delete
foreach ( $this->importers as $importer ) {
[53] Fix | Delete
$importers = $importer->register( $importers );
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
return apply_filters( 'wpforms_importers', $importers );
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Get a importer forms.
[61] Fix | Delete
*
[62] Fix | Delete
* @since 1.6.6
[63] Fix | Delete
*
[64] Fix | Delete
* @param string $provider Provider.
[65] Fix | Delete
*
[66] Fix | Delete
* @return array
[67] Fix | Delete
*/
[68] Fix | Delete
public function get_importer_forms( $provider ) {
[69] Fix | Delete
[70] Fix | Delete
if ( isset( $this->importers[ $provider ] ) ) {
[71] Fix | Delete
return apply_filters( "wpforms_importer_forms_{$provider}", $this->importers[ $provider ]->get_forms() );
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
return [];
[75] Fix | Delete
}
[76] Fix | Delete
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function