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/wp-conte.../plugins/embedpre.../vendor/priyomuk.../wp-notic.../src/Utils
File: NoticeRemover.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace PriyoMukul\WPNotice\Utils;
[2] Fix | Delete
[3] Fix | Delete
use PriyoMukul\WPNotice\Notices;
[4] Fix | Delete
[5] Fix | Delete
class NoticeRemover {
[6] Fix | Delete
private static $instance = null;
[7] Fix | Delete
[8] Fix | Delete
public static function get_instance( $version ) {
[9] Fix | Delete
if ( self::$instance == null ) {
[10] Fix | Delete
self::$instance = new static( $version );
[11] Fix | Delete
}
[12] Fix | Delete
[13] Fix | Delete
return self::$instance;
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
public function __construct( $version = '1.0.0', $instanceOf = null ) {
[17] Fix | Delete
add_action( 'init', function () use ( $version, $instanceOf ) {
[18] Fix | Delete
global $wp_filter;
[19] Fix | Delete
[20] Fix | Delete
if ( $instanceOf === null ) {
[21] Fix | Delete
$instanceOf = Notices::class;
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
foreach ( $wp_filter['admin_notices']->callbacks[10] as $callback ) {
[25] Fix | Delete
if ( is_array( $callback['function'] ) && $callback['function'][0] instanceof $instanceOf ) {
[26] Fix | Delete
$notice = $callback['function'][0];
[27] Fix | Delete
[28] Fix | Delete
if ( $notice->version === $version ) {
[29] Fix | Delete
remove_action( 'admin_notices', [ $notice, 'notices' ] );
[30] Fix | Delete
remove_action( 'admin_footer', [ $notice, 'scripts' ] );
[31] Fix | Delete
}
[32] Fix | Delete
}
[33] Fix | Delete
}
[34] Fix | Delete
} );
[35] Fix | Delete
}
[36] Fix | Delete
}
[37] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function