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

Chouby on "[Plugin: Polylang] Theme page: author.php returns to home instead of other language"

$
0
0

I don't get this warning, so there may be a copy paste issue. However making the test, I noticed an error even worse.

<?php
/*
Plugin name: forces Polylang linking to author translation
*/

add_filter('pll_translation_url', 'pll_author_translation_url', 10, 2);

function pll_author_translation_url($url, $lang) {
	if (is_author()) {
		global $polylang;
		return $polylang->links->get_archive_url($polylang->model->get_language($lang));
	}
	return $url;
}

It enables the link to an empty author page (a page not found in twenty twelve).


Viewing all articles
Browse latest Browse all 11471

Trending Articles



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