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.../blocks/views/includes/DataBuil...
File: SubmissionsBuilderFactory.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace NinjaForms\Blocks\DataBuilder;
[2] Fix | Delete
[3] Fix | Delete
class SubmissionsBuilderFactory {
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* @param int $formID
[7] Fix | Delete
* @param int $perPage
[8] Fix | Delete
* @param int $page
[9] Fix | Delete
*
[10] Fix | Delete
* @return SubmissionsBuilder
[11] Fix | Delete
*/
[12] Fix | Delete
public function make( $formID, $perPage = -1, $page = 0 ) {
[13] Fix | Delete
[14] Fix | Delete
$args = [
[15] Fix | Delete
'posts_per_page' => $perPage,
[16] Fix | Delete
'paged' => $page,
[17] Fix | Delete
'post_type' => 'nf_sub',
[18] Fix | Delete
'meta_query' => [[
[19] Fix | Delete
'key' => '_form_id',
[20] Fix | Delete
'value' => $formID
[21] Fix | Delete
]]
[22] Fix | Delete
];
[23] Fix | Delete
[24] Fix | Delete
$submissions = array_map( function( $post ) {
[25] Fix | Delete
return array_map( [ self::class, 'flattenPostmeta' ], get_post_meta( $post->ID ) );
[26] Fix | Delete
}, get_posts( $args ) );
[27] Fix | Delete
[28] Fix | Delete
return new SubmissionsBuilder( $submissions );
[29] Fix | Delete
}
[30] Fix | Delete
[31] Fix | Delete
protected static function flattenPostmeta( $postmeta ) {
[32] Fix | Delete
$postmeta = (array) $postmeta;
[33] Fix | Delete
return reset( $postmeta );
[34] Fix | Delete
}
[35] Fix | Delete
}
[36] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function