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/clone/wp-conte.../plugins/accelera.../pagebuil.../modules
File: contact-form-shortcode-module.php
<?php
[0] Fix | Delete
// Exit if accessed directly.
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) exit;
[2] Fix | Delete
$output = '
[3] Fix | Delete
{{if_condition_form_type==contact-form-7}}
[4] Fix | Delete
[contact-form-7 id="{{cf7_form_id}}"]
[5] Fix | Delete
{{ifend_condition_form_type_contact-form-7}}
[6] Fix | Delete
[7] Fix | Delete
{{if_condition_form_type==gravityform}}
[8] Fix | Delete
[gravityform id="{{gf_form_id}}" title="true" description="true"]
[9] Fix | Delete
{{ifend_condition_form_type_gravityform}}
[10] Fix | Delete
[11] Fix | Delete
{{if_condition_form_type==wpforms}}
[12] Fix | Delete
[wpforms id="{{wp_forms_id}}"]
[13] Fix | Delete
{{ifend_condition_form_type_wpforms}}
[14] Fix | Delete
[15] Fix | Delete
{{if_condition_form_type==ninja_form}}
[16] Fix | Delete
[ninja_form id="{{nj_forms_id}}"]
[17] Fix | Delete
{{ifend_condition_form_type_ninja_form}}
[18] Fix | Delete
';
[19] Fix | Delete
[20] Fix | Delete
$css = $args = '';
[21] Fix | Delete
$formSupported = array();
[22] Fix | Delete
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
[23] Fix | Delete
if(is_plugin_active('amp-cf7/amp-cf7.php')){
[24] Fix | Delete
$formSupported = array_merge($formSupported, array('contact-form-7'=>'Contact Form 7'));
[25] Fix | Delete
[26] Fix | Delete
$args = array('post_type' => 'wpcf7_contact_form', 'posts_per_page' => -1);
[27] Fix | Delete
$cf7Forms = get_posts( $args );
[28] Fix | Delete
$form_titles = wp_list_pluck( $cf7Forms , 'post_title' );
[29] Fix | Delete
$form_id = wp_list_pluck( $cf7Forms , 'ID' );
[30] Fix | Delete
$cf7formArray = array();
[31] Fix | Delete
if(count($form_titles)>0){
[32] Fix | Delete
foreach ($form_titles as $key => $formName) {
[33] Fix | Delete
$formName = esc_html($formName);
[34] Fix | Delete
$cf7formArray[$form_id[$key]] = $formName;
[35] Fix | Delete
}
[36] Fix | Delete
}
[37] Fix | Delete
$cf7FormsList = array(array(
[38] Fix | Delete
'type' =>'select',
[39] Fix | Delete
'name' =>'cf7_form_id',
[40] Fix | Delete
'label' =>"Select Form",
[41] Fix | Delete
'tab' =>'customizer',
[42] Fix | Delete
'default' =>'',
[43] Fix | Delete
'options_details'=>$cf7formArray,
[44] Fix | Delete
'content_type'=>'html',
[45] Fix | Delete
'required' => array('form_type' => 'contact-form-7'),
[46] Fix | Delete
));
[47] Fix | Delete
[48] Fix | Delete
}
[49] Fix | Delete
if(is_plugin_active('amp-gravity-forms/amp-gravity-forms.php') && class_exists('RGFormsModel')){
[50] Fix | Delete
$formSupported = array_merge($formSupported, array('gravityform'=>'Gravity Form'));
[51] Fix | Delete
[52] Fix | Delete
$apbGFforms = RGFormsModel::get_forms();
[53] Fix | Delete
$grvtyformArray = array();
[54] Fix | Delete
if(count($apbGFforms)){
[55] Fix | Delete
foreach( $apbGFforms as $form ):
[56] Fix | Delete
$grvtyformArray[$form->id] = $form->title;
[57] Fix | Delete
endforeach;
[58] Fix | Delete
}
[59] Fix | Delete
$gravityFormsList = array(array(
[60] Fix | Delete
'type' =>'select',
[61] Fix | Delete
'name' =>'gf_form_id',
[62] Fix | Delete
'label' =>"Select Form",
[63] Fix | Delete
'tab' =>'customizer',
[64] Fix | Delete
'default' =>'',
[65] Fix | Delete
'options_details'=>$grvtyformArray,
[66] Fix | Delete
'content_type'=>'html',
[67] Fix | Delete
'required' => array('form_type' => 'gravityform'),
[68] Fix | Delete
));
[69] Fix | Delete
}
[70] Fix | Delete
if(function_exists('ampforwp_wpforms_initiate_plugin')){
[71] Fix | Delete
$formSupported = array_merge($formSupported, array('wpforms'=>'WP Forms'));
[72] Fix | Delete
[73] Fix | Delete
//$args = apply_filters( 'wpforms_modal_select', array() );
[74] Fix | Delete
// No ID provided, get multiple forms
[75] Fix | Delete
$defaults = array(
[76] Fix | Delete
'post_type' => 'wpforms',
[77] Fix | Delete
'orderby' => 'id',
[78] Fix | Delete
'order' => 'ASC',
[79] Fix | Delete
'no_found_rows' => true,
[80] Fix | Delete
'nopaging' => true,
[81] Fix | Delete
);
[82] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[83] Fix | Delete
$args['post_type'] = 'wpforms';
[84] Fix | Delete
$forms = get_posts( $args );
[85] Fix | Delete
$wpformsArray = array();
[86] Fix | Delete
if(count($forms)){
[87] Fix | Delete
foreach( $forms as $form ):
[88] Fix | Delete
$wpformsArray[$form->ID] = $form->post_title;
[89] Fix | Delete
endforeach;
[90] Fix | Delete
}
[91] Fix | Delete
$wpformsList = array(array(
[92] Fix | Delete
'type' =>'select',
[93] Fix | Delete
'name' =>'wp_forms_id',
[94] Fix | Delete
'label' =>"Select Form",
[95] Fix | Delete
'tab' =>'customizer',
[96] Fix | Delete
'default' =>'',
[97] Fix | Delete
'options_details'=>$wpformsArray,
[98] Fix | Delete
'content_type'=>'html',
[99] Fix | Delete
'required' => array('form_type' => 'wpforms'),
[100] Fix | Delete
));
[101] Fix | Delete
}
[102] Fix | Delete
if(is_plugin_active('amp-ninja-forms/amp-ninja-forms.php') && function_exists('Ninja_Forms')){
[103] Fix | Delete
$formSupported = array_merge($formSupported, array('ninja_form'=>'Ninja Forms'));
[104] Fix | Delete
[105] Fix | Delete
$ninjaforms_modified = array();
[106] Fix | Delete
[107] Fix | Delete
if ( get_option( 'ninja_forms_load_deprecated', false ) ) {
[108] Fix | Delete
$forms = Ninja_Forms()->forms()->get_all();
[109] Fix | Delete
[110] Fix | Delete
foreach ( $forms as $form_id ) {
[111] Fix | Delete
$ninjaforms_modified[ $form_id ] = Ninja_Forms()->form( $form_id )->get_setting( 'form_title' );;
[112] Fix | Delete
}
[113] Fix | Delete
} else {
[114] Fix | Delete
$forms = Ninja_Forms()->form()->get_forms();
[115] Fix | Delete
foreach ( $forms as $index => $form ) {
[116] Fix | Delete
$ninjaforms_modified[ $form->get_id() ] = $form->get_setting( 'title' );
[117] Fix | Delete
}
[118] Fix | Delete
}
[119] Fix | Delete
$ninjaFormList = array(array(
[120] Fix | Delete
'type' =>'select',
[121] Fix | Delete
'name' =>'nj_forms_id',
[122] Fix | Delete
'label' =>"Select Form",
[123] Fix | Delete
'tab' =>'customizer',
[124] Fix | Delete
'default' =>'',
[125] Fix | Delete
'options_details'=>$ninjaforms_modified,
[126] Fix | Delete
'content_type'=>'html',
[127] Fix | Delete
'required' => array('form_type' => 'ninja_form'),
[128] Fix | Delete
));
[129] Fix | Delete
}
[130] Fix | Delete
[131] Fix | Delete
$formFields = array(
[132] Fix | Delete
array(
[133] Fix | Delete
'type' =>'select',
[134] Fix | Delete
'name' =>'form_type',
[135] Fix | Delete
'label' =>"Select Form",
[136] Fix | Delete
'tab' =>'customizer',
[137] Fix | Delete
'default' =>'',
[138] Fix | Delete
'options_details'=>$formSupported,
[139] Fix | Delete
'content_type'=>'html',
[140] Fix | Delete
'helpmessage' => 'This module requires <a href="https://ampforwp.com/contact-form-7" target="_blank">AMP Contact Form 7</a> , <a href="https://ampforwp.com/gravity-forms/" target="_blank">AMP Gravity Forms</a> or <a href="https://ampforwp.com/ninja-forms/" target="_blank">Ninja Forms for AMP</a> Extension. <a target="_blank" href="https://ampforwp.com/extensions/">View all the Extensions</a>'
[141] Fix | Delete
),
[142] Fix | Delete
);
[143] Fix | Delete
if(isset($cf7FormsList)){
[144] Fix | Delete
$formFields = array_merge($formFields, $cf7FormsList);
[145] Fix | Delete
}
[146] Fix | Delete
if(isset($gravityFormsList)){
[147] Fix | Delete
$formFields = array_merge($formFields, $gravityFormsList);
[148] Fix | Delete
}
[149] Fix | Delete
if(isset($wpformsList)){
[150] Fix | Delete
$formFields = array_merge($formFields, $wpformsList);
[151] Fix | Delete
}
[152] Fix | Delete
if(isset($ninjaFormList)){
[153] Fix | Delete
$formFields = array_merge($formFields, $ninjaFormList);
[154] Fix | Delete
}
[155] Fix | Delete
return array(
[156] Fix | Delete
'label' =>'Contact Forms',
[157] Fix | Delete
'name' =>'contact-form-shortcode',
[158] Fix | Delete
'default_tab'=> 'customizer',
[159] Fix | Delete
'tabs' => array(
[160] Fix | Delete
'customizer'=>'Content',
[161] Fix | Delete
'design'=>'Design',
[162] Fix | Delete
'advanced' => 'Advanced',
[163] Fix | Delete
'layout' => 'Layout'
[164] Fix | Delete
),
[165] Fix | Delete
'fields' => $formFields,
[166] Fix | Delete
'front_template'=> $output,
[167] Fix | Delete
'front_common_css'=>'',
[168] Fix | Delete
);
[169] Fix | Delete
[170] Fix | Delete
?>
[171] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function