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/advanced.../src
File: Group_Repository.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Group Repository class.
[2] Fix | Delete
*
[3] Fix | Delete
* @package AdvancedAds
[4] Fix | Delete
* @author Advanced Ads <info@wpadvancedads.com>
[5] Fix | Delete
*/
[6] Fix | Delete
[7] Fix | Delete
namespace Advanced_Ads;
[8] Fix | Delete
[9] Fix | Delete
use WP_Term;
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* Group Repository/Factory class.
[13] Fix | Delete
* Ensures every ad is only set-up once and the same instance is re-used within one request.
[14] Fix | Delete
*/
[15] Fix | Delete
class Group_Repository extends Abstract_Repository {
[16] Fix | Delete
/**
[17] Fix | Delete
* Array to hold the \Advanced_Ads_Group objects, indexed by the term.
[18] Fix | Delete
*
[19] Fix | Delete
* @var array
[20] Fix | Delete
*/
[21] Fix | Delete
protected static $repo = [];
[22] Fix | Delete
[23] Fix | Delete
/**
[24] Fix | Delete
* Get the ad object from the repository. Create and add it, if it doesn't exist.
[25] Fix | Delete
* If the passed id is not an ad, return the created ad object without adding it to the repository.
[26] Fix | Delete
* This behavior prevents breaking changes.
[27] Fix | Delete
*
[28] Fix | Delete
* @param int|WP_Term $term The term to look for.
[29] Fix | Delete
*
[30] Fix | Delete
* @return \Advanced_Ads_Group
[31] Fix | Delete
*/
[32] Fix | Delete
public static function get( $term ): \Advanced_Ads_Group {
[33] Fix | Delete
$id = $term->term_id ?? $term;
[34] Fix | Delete
if ( ! self::has( $id ) ) {
[35] Fix | Delete
$group = new \Advanced_Ads_Group( $term );
[36] Fix | Delete
if ( ! $group->is_group ) {
[37] Fix | Delete
return $group;
[38] Fix | Delete
}
[39] Fix | Delete
self::$repo[ $id ] = $group;
[40] Fix | Delete
}
[41] Fix | Delete
[42] Fix | Delete
return self::$repo[ $id ];
[43] Fix | Delete
}
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function