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: mappress-google-maps-for-wordpress.php
<?php
[0] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[1] Fix | Delete
exit; // Exit if accessed directly
[2] Fix | Delete
}
[3] Fix | Delete
[4] Fix | Delete
/**
[5] Fix | Delete
* Plugin compatibility for "MapPress Easy Google Maps"
[6] Fix | Delete
* @since 3.0.98
[7] Fix | Delete
* @link https://wordpress.org/plugins/insert-pages/
[8] Fix | Delete
*/
[9] Fix | Delete
class ET_Builder_Plugin_Compat_Mappress extends ET_Builder_Plugin_Compat_Base {
[10] Fix | Delete
/**
[11] Fix | Delete
* Constructor
[12] Fix | Delete
*/
[13] Fix | Delete
function __construct() {
[14] Fix | Delete
$this->plugin_id = "mappress-google-maps-for-wordpress/mappress.php";
[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
* Once this issue is fixed in future version, do version_compare() to limit the scope of the fix
[21] Fix | Delete
* Latest plugin version: 2.47.5
[22] Fix | Delete
* @return void
[23] Fix | Delete
*/
[24] Fix | Delete
function init_hooks() {
[25] Fix | Delete
// Bail if there's no version found
[26] Fix | Delete
if ( ! $this->get_plugin_version() ) {
[27] Fix | Delete
return;
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
// Up to: latest plugin version
[31] Fix | Delete
add_action( 'wp_footer', array( $this, 'dequeue_scripts' ) );
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* Mappress loads the exact same Google Maps library Divi is using which causes an issue
[36] Fix | Delete
* @return void
[37] Fix | Delete
*/
[38] Fix | Delete
function dequeue_scripts() {
[39] Fix | Delete
// Check if current page is builder page and enqueueing Google Maps script
[40] Fix | Delete
if ( is_singular() && et_pb_is_pagebuilder_used( get_the_ID() ) && et_pb_enqueue_google_maps_script() ) {
[41] Fix | Delete
// Deregister MapPress' Google Maps
[42] Fix | Delete
wp_dequeue_script( 'mappress-gmaps' );
[43] Fix | Delete
[44] Fix | Delete
// There's no cleaner way to add dependency to registered script, thus direct access to
[45] Fix | Delete
// $wp_scripts. Append Divi's google maps handle to make MapPress' script depends on it
[46] Fix | Delete
global $wp_scripts;
[47] Fix | Delete
[48] Fix | Delete
if ( isset( $wp_scripts->registered['mappress'] ) && ! in_array( 'google-maps-api', $wp_scripts->registered['mappress']->deps ) ) {
[49] Fix | Delete
$wp_scripts->registered['mappress']->deps[] = 'google-maps-api';
[50] Fix | Delete
}
[51] Fix | Delete
}
[52] Fix | Delete
}
[53] Fix | Delete
}
[54] Fix | Delete
new ET_Builder_Plugin_Compat_Mappress;
[55] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function