Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Chouby on "Polylang interferes with common image(s)"

$
0
0

Fatal error. Sorry, I badly read the documentation of the str_replace function :(
Could you try this?
Replace:

$form = $this->using_permalinks ?
	str_replace(trailingslashit($this->home), $this->get_home_url($this->curlang, true), $form) :
	str_replace('</form>', '<input type="hidden" name="lang" value="'.esc_attr($this->curlang->slug).'" /></form>', $form);

by:

if ($this->using_permalinks) {
	preg_match('#<form.+>#', $form, $matches);
	$old = reset($matches);
	$new = str_replace(trailingslashit($this->home), $this->get_home_url($this->curlang, true), $old);
	$form = str_replace($old, $new, $form);
}
else
	$form = str_replace('</form>', '<input type="hidden" name="lang" value="'.esc_attr($this->curlang->slug).'" /></form>', $form);

Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>