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

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wpforms-.../src/Admin/Payments/Views/Overview
File: Ajax.php
* @param array $results Query results.
[500] Fix | Delete
*
[501] Fix | Delete
* @return array
[502] Fix | Delete
*/
[503] Fix | Delete
private function maybe_format_amounts( $results ) {
[504] Fix | Delete
[505] Fix | Delete
// If the input is empty, leave early.
[506] Fix | Delete
if ( empty( $results ) ) {
[507] Fix | Delete
return [];
[508] Fix | Delete
}
[509] Fix | Delete
[510] Fix | Delete
foreach ( $results as $key => $value ) {
[511] Fix | Delete
// If the given stat card doesn't have a button class, leave early.
[512] Fix | Delete
// If the given stat card doesn't have a button class of "is-amount," leave early.
[513] Fix | Delete
if ( ! isset( $this->stat_cards[ $key ]['button_classes'] ) || ! in_array( 'is-amount', $this->stat_cards[ $key ]['button_classes'], true ) ) {
[514] Fix | Delete
continue;
[515] Fix | Delete
}
[516] Fix | Delete
[517] Fix | Delete
// Split the input by space to look for the count.
[518] Fix | Delete
$input_arr = (array) explode( ' ', $value );
[519] Fix | Delete
[520] Fix | Delete
// If the given stat card doesn't have a count, leave early.
[521] Fix | Delete
if ( empty( $this->stat_cards[ $key ]['has_count'] ) || ! isset( $input_arr[1] ) ) {
[522] Fix | Delete
// Format the given amount and split the input by space.
[523] Fix | Delete
$results[ $key ] = wpforms_format_amount( $value, true );
[524] Fix | Delete
[525] Fix | Delete
continue;
[526] Fix | Delete
}
[527] Fix | Delete
[528] Fix | Delete
// The fields are stored as a `decimal` in the DB, and appears here as the string.
[529] Fix | Delete
// But all strings values, passed to wpforms_format_amount() are sanitized.
[530] Fix | Delete
// There is no need to sanitize it, as it is already a regular numeric string.
[531] Fix | Delete
$amount = wpforms_format_amount( (float) ( $input_arr[0] ?? $value ), true );
[532] Fix | Delete
[533] Fix | Delete
// Format the amount with the concatenation of count in parentheses.
[534] Fix | Delete
// Example: 2185.52000000 (79).
[535] Fix | Delete
$results[ $key ] = sprintf(
[536] Fix | Delete
'%s <span>%s</span>',
[537] Fix | Delete
esc_html( $amount ),
[538] Fix | Delete
esc_html( $input_arr[1] ) // 1: Would be count of the records.
[539] Fix | Delete
);
[540] Fix | Delete
}
[541] Fix | Delete
[542] Fix | Delete
return $results;
[543] Fix | Delete
}
[544] Fix | Delete
}
[545] Fix | Delete
[546] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function