: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
use WPML\Core\Twig_Loader_Filesystem;
use WPML\Core\Twig_Environment;
* Class WPML_Twig_Template_Loader
class WPML_Twig_Template_Loader {
* WPML_Twig_Template_Loader constructor.
public function __construct( array $paths ) {
* @return WPML_Twig_Template
public function get_template() {
$twig_loader = new Twig_Loader_Filesystem( $this->paths );
$environment_args = array();
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
$environment_args['debug'] = true;
$twig = new Twig_Environment( $twig_loader, $environment_args );
return new WPML_Twig_Template( $twig );