• Resolved Archie Makuwa

    (@archie22is)


    I have a custom registration form that works without caching and registered a user with a new custom user role “Wholesale”.

    Whenever I register with total cache enabled, this is what I get:
    https://i.prntscr.com/UXE_2hpVQCGKY2tXEfV5Ow.png

    What am I missing here?:
    $user_meta = get_userdata($user_id);

    I used $user_meta = get_userdata($user_id); to retrieve the “roles” but it only works when the cache is switched off. I am not sure if the issue with caching comes from the core itself or the plugin.

Viewing 1 replies (of 1 total)
  • Thread Starter Archie Makuwa

    (@archie22is)

    A solution for anyone who ever experiences this problem:

    – It is caused by caching the wp-admin (dashboard requests), simply untick “Enable caching for wp-admin requests” in the W3C Total Cache plugin. You should be able to gain control of what get_users() returns without running into issues.

Viewing 1 replies (of 1 total)
  • The topic ‘get_user_by() not working with W3 Total Cache’ is closed to new replies.