wp-multilang icon indicating copy to clipboard operation
wp-multilang copied to clipboard

Proper Edit link in Admin bar

Open ram108 opened this issue 5 years ago • 2 comments

When you click Edit link in Admin bar, the editor does not always open in the language of the article.

For example, you are viewing an article in Russian language and click 'Edit post', the editor can open English version. To fix this, add the following to you functions.php of the theme.

// Fix post edit link
if ( function_exists('wpm_get_language') ) add_filter('get_edit_post_link', function ($link, $post_id, $context) {
    return strpos($link, '&edit_lang=') ? $link : $link.'&edit_lang='.wpm_get_language();
}, 99, 3);

ram108 avatar Sep 29 '19 18:09 ram108

Thank you ram108 for this contribution. Hope Valentyn will update soon. Cheers,

Anticosti avatar Sep 29 '19 18:09 Anticosti

Hope Valentyn will update soon. It were no updates since 1y already. I dont think this project is alive.

ram108 avatar Oct 01 '19 16:10 ram108