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/sitepres.../compatib.../gutenber...
File: wpml-compatibility-gutenberg.php
<?php
[0] Fix | Delete
[1] Fix | Delete
class WPML_Compatibility_Gutenberg implements IWPML_Action {
[2] Fix | Delete
[3] Fix | Delete
/**
[4] Fix | Delete
* We need to load the filter after `wpml_before_init` where ST loads the blocking filter
[5] Fix | Delete
* and before `plugins_loaded` (priority 10) where Gutenberg loads the text domain.
[6] Fix | Delete
*/
[7] Fix | Delete
const PRIORITY_ON_PLUGINS_LOADED = 5;
[8] Fix | Delete
[9] Fix | Delete
/** @var WPML_PHP_Functions $php_functions */
[10] Fix | Delete
private $php_functions;
[11] Fix | Delete
[12] Fix | Delete
public function __construct( WPML_PHP_Functions $php_functions = null ) {
[13] Fix | Delete
$this->php_functions = $php_functions;
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
public function add_hooks() {
[17] Fix | Delete
add_action( 'plugins_loaded', array( $this, 'load_textdomain_filter' ), self::PRIORITY_ON_PLUGINS_LOADED );
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
public function load_textdomain_filter() {
[21] Fix | Delete
if ( $this->php_functions->defined( 'WPML_ST_VERSION' )
[22] Fix | Delete
&& $this->php_functions->function_exists( 'gutenberg_load_plugin_textdomain' )
[23] Fix | Delete
) {
[24] Fix | Delete
add_filter( 'override_load_textdomain', array( $this, 'unblock_gutenberg_domain' ), PHP_INT_MAX, 2 );
[25] Fix | Delete
}
[26] Fix | Delete
}
[27] Fix | Delete
[28] Fix | Delete
/**
[29] Fix | Delete
* @param bool $override
[30] Fix | Delete
* @param string $domain
[31] Fix | Delete
*
[32] Fix | Delete
* @return bool
[33] Fix | Delete
*/
[34] Fix | Delete
public function unblock_gutenberg_domain( $override, $domain ) {
[35] Fix | Delete
if ( 'gutenberg' === $domain ) {
[36] Fix | Delete
return false;
[37] Fix | Delete
}
[38] Fix | Delete
[39] Fix | Delete
return $override;
[40] Fix | Delete
}
[41] Fix | Delete
}
[42] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function