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/network-.../componen.../settings
File: NetsPostsNetworkSettings.php
<?php
[0] Fix | Delete
[1] Fix | Delete
[2] Fix | Delete
namespace NetworkPosts\Components\Settings;
[3] Fix | Delete
[4] Fix | Delete
[5] Fix | Delete
class NetsPostsNetworkSettings {
[6] Fix | Delete
[7] Fix | Delete
const DENY_EXCERPT_TAGS_OPTION = 'netsposts_deny_excerpt_tags';
[8] Fix | Delete
[9] Fix | Delete
public static function is_excerpt_tags_denied( int $blog_id ): bool {
[10] Fix | Delete
$blogs = self::get_restricted_excerpt_tag_blogs();
[11] Fix | Delete
return is_array( $blogs ) && in_array( $blog_id, $blogs );
[12] Fix | Delete
}
[13] Fix | Delete
[14] Fix | Delete
public static function get_restricted_excerpt_tag_blogs(): array {
[15] Fix | Delete
$blogs_option = get_site_option( self::DENY_EXCERPT_TAGS_OPTION, null );
[16] Fix | Delete
if( !$blogs_option ){
[17] Fix | Delete
$blogs = get_sites( array( 'fields' => 'ids', 'public' => 1 ) );
[18] Fix | Delete
self::set_denied_excerpt_tag_blogs( $blogs );
[19] Fix | Delete
return $blogs;
[20] Fix | Delete
}
[21] Fix | Delete
if( is_serialized( $blogs_option ) ) {
[22] Fix | Delete
return unserialize( $blogs_option );
[23] Fix | Delete
}
[24] Fix | Delete
return [];
[25] Fix | Delete
}
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* @param int[] $blogs
[29] Fix | Delete
*/
[30] Fix | Delete
public static function set_denied_excerpt_tag_blogs( array $blogs ): void {
[31] Fix | Delete
if( empty( $blogs ) ){
[32] Fix | Delete
delete_site_option( self::DENY_EXCERPT_TAGS_OPTION );
[33] Fix | Delete
}
[34] Fix | Delete
else{
[35] Fix | Delete
update_site_option( self::DENY_EXCERPT_TAGS_OPTION, serialize( $blogs ) );
[36] Fix | Delete
}
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
public static function allow_excerpt_tags_for_blog( int $blog_id ): void {
[40] Fix | Delete
$blogs = self::get_restricted_excerpt_tag_blogs();
[41] Fix | Delete
$index = array_search( $blog_id , $blogs);
[42] Fix | Delete
if($index !== false) {
[43] Fix | Delete
unset( $blogs[$index] );
[44] Fix | Delete
$blogs = array_values( $blogs );
[45] Fix | Delete
self::set_denied_excerpt_tag_blogs( $blogs );
[46] Fix | Delete
}
[47] Fix | Delete
}
[48] Fix | Delete
[49] Fix | Delete
public static function deny_excerpt_tags_for_blog( $blog_id ): void {
[50] Fix | Delete
$blogs = self::get_restricted_excerpt_tag_blogs();
[51] Fix | Delete
if( !in_array( $blog_id, $blogs ) ){
[52] Fix | Delete
$blogs[] = $blog_id;
[53] Fix | Delete
self::set_denied_excerpt_tag_blogs( $blogs );
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
[57] Fix | Delete
}
[58] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function