Support » Plugin: WP Last Login » New users don’t get the meta field?

  • Resolved Brugman

    (@brugman)


    Hi Konstantin.

    On a multisite I’ve ran into a problem with your plugin. There’s no code that sets the user meta field to 0 when a user account is created by an admin. This causes users to be shown in the Network Admin user list, but not in the subsite user list – because of pre_get_users(). Making them appear missing.

    I’ve fixed the situation momentarily by deactivating and activating the plugin network-wide. So wpll_activate() runs and everyone gets wp-last-login 0.

    To fix it for all future users I suppose this will do:

    add_action( 'user_register', function ( $user_id ) {
        update_user_meta( $user_id, 'wp-last-login', 0 );
    }, 10, 1 );

    Can you confirm this is a bug? (And then merge the fix) Or is it something specific to my site.

    Thanks!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.