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.../themes/Divi/includes/builder/plugin-c...
File: wordpress-mu-domain-mapping.php
<?php
[0] Fix | Delete
[1] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[2] Fix | Delete
exit; // Exit if accessed directly
[3] Fix | Delete
}
[4] Fix | Delete
[5] Fix | Delete
/**
[6] Fix | Delete
* Plugin compatibility for WordPress MU Domain Mapping
[7] Fix | Delete
*/
[8] Fix | Delete
class ET_Builder_Plugin_Compat_Mu_Domain_Mapping extends ET_Builder_Plugin_Compat_Base {
[9] Fix | Delete
/**
[10] Fix | Delete
* Constructor
[11] Fix | Delete
*/
[12] Fix | Delete
function __construct() {
[13] Fix | Delete
$this->plugin_id = 'wordpress-mu-domain-mapping/domain_mapping.php';
[14] Fix | Delete
[15] Fix | Delete
$this->init_hooks();
[16] Fix | Delete
}
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Hook methods to WordPress
[20] Fix | Delete
*
[21] Fix | Delete
* @return void
[22] Fix | Delete
*/
[23] Fix | Delete
function init_hooks() {
[24] Fix | Delete
if ( ! function_exists( 'redirect_to_mapped_domain' ) ) {
[25] Fix | Delete
return;
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
$enabled = array(
[29] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification.NoNonceVerification
[30] Fix | Delete
'vb' => et_()->array_get( $_GET, 'et_fb' ),
[31] Fix | Delete
'bfb' => et_()->array_get( $_GET, 'et_bfb' ),
[32] Fix | Delete
// phpcs:enable
[33] Fix | Delete
);
[34] Fix | Delete
[35] Fix | Delete
// I know what you're thinking .... can't check for 'edit_post' because too early
[36] Fix | Delete
// and don't have a post ID yet but will do inside the filter.
[37] Fix | Delete
if ( ( $enabled['vb'] || $enabled['bfb'] ) && current_user_can( 'edit_posts' ) ) {
[38] Fix | Delete
// Override plugin's redirection code.
[39] Fix | Delete
remove_action( 'template_redirect', 'redirect_to_mapped_domain' );
[40] Fix | Delete
add_action( 'template_redirect', array( $this, 'redirect' ) );
[41] Fix | Delete
}
[42] Fix | Delete
}
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Disable plugin redirections when VB/BFB page and current user can edit.
[46] Fix | Delete
*
[47] Fix | Delete
* @return void
[48] Fix | Delete
*/
[49] Fix | Delete
public function redirect() {
[50] Fix | Delete
global $post;
[51] Fix | Delete
if ( ! ( $post && current_user_can( 'edit_post', $post->ID ) ) ) {
[52] Fix | Delete
// Perform redirections anyway when current user cannot edit the page.
[53] Fix | Delete
redirect_to_mapped_domain();
[54] Fix | Delete
}
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
[58] Fix | Delete
new ET_Builder_Plugin_Compat_Mu_Domain_Mapping();
[59] Fix | Delete
[60] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function