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/ninja-fo.../includes/Fields
File: Total.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Class NF_Field_Total
[3] Fix | Delete
*/
[4] Fix | Delete
class NF_Fields_Total extends NF_Abstracts_Input
[5] Fix | Delete
{
[6] Fix | Delete
protected $_name = 'total';
[7] Fix | Delete
[8] Fix | Delete
protected $_section = '';
[9] Fix | Delete
[10] Fix | Delete
protected $_icon = 'money';
[11] Fix | Delete
[12] Fix | Delete
protected $_aliases = array();
[13] Fix | Delete
[14] Fix | Delete
protected $_type = 'total';
[15] Fix | Delete
[16] Fix | Delete
protected $_templates = 'total';
[17] Fix | Delete
[18] Fix | Delete
protected $_test_value = '0.00';
[19] Fix | Delete
[20] Fix | Delete
protected $_settings_exclude = array( 'placeholder', 'default', 'input_limit_set', 'disable_input', 'required' );
[21] Fix | Delete
[22] Fix | Delete
public function __construct()
[23] Fix | Delete
{
[24] Fix | Delete
parent::__construct();
[25] Fix | Delete
[26] Fix | Delete
$this->_nicename = esc_html__( 'Total', 'ninja-forms' );
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
public function process( $total, $data )
[30] Fix | Delete
{
[31] Fix | Delete
$subtotal = 0;
[32] Fix | Delete
[33] Fix | Delete
foreach( $data[ 'fields' ] as $key => $field ){
[34] Fix | Delete
[35] Fix | Delete
if( isset ( $field[ 'type' ] ) && 'shipping' == $field[ 'type' ] ){
[36] Fix | Delete
$subtotal += (float)$field[ 'shipping_cost' ];
[37] Fix | Delete
}
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
if( isset( $data[ 'product_totals' ] ) ){
[41] Fix | Delete
[42] Fix | Delete
foreach( $data[ 'product_totals' ] as $product_total ){
[43] Fix | Delete
[44] Fix | Delete
$subtotal += (float)$product_total;
[45] Fix | Delete
}
[46] Fix | Delete
}
[47] Fix | Delete
[48] Fix | Delete
$data[ 'new_total' ] = number_format( $subtotal, 2 );
[49] Fix | Delete
[50] Fix | Delete
return $data;
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
[54] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function