: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Themify Compatibility Code
* @link https://wpml.org/
class Themify_Compat_wpml {
if ( class_exists( 'SitePress',false ) ) {
add_action( 'themify_search_fields', [ __CLASS__, 'themify_search_fields' ] );
* Add current language to the search form, fix Ajax search with WPML
public static function themify_search_fields() {
$current_language = $sitepress->get_current_language();
echo '<input type="hidden" name="lang" value="' . esc_attr( $current_language ) . '" />';