plugins - WPML - Hook when language is switched (change user language)

I would like to change the logged in user's language (if someone is logged in) when they change the language in fro

I would like to change the logged in user's language (if someone is logged in) when they change the language in front-end.

I'm using the WPML Multilingual CMS plugin in my Wordpress website.

I've tried to add this code in my custom plugin:

add_action('wpml_language_has_switched', 'change_user_language_in_database');

function change_user_language_in_database()
{
  die("test function");
}

The problem is that this function is always triggered. Also when the language isn't switched.

The version of WPML Multilingual CMS plugin is 4.2.7.1.

What am I doing wrong?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745153651a4613984.html

相关推荐

  • plugins - WPML - Hook when language is switched (change user language)

    I would like to change the logged in user's language (if someone is logged in) when they change the language in fro

    2小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信