Question

I'm having a hard time figuring this one out.

I'm running a simple users query :

$args = array(
    'role' => 'custom_role',
    'orderby' => 'ID',
    'order' => 'DESC',
    'number' => 3
);
$users = get_users( $args );

And the resulting array has duplicate entries :

Array
(
    [0] => stdClass Object
        (
            [ID] => 11433
            [user_login] => peterpanpan
            [user_pass] => $P$B1SJOYhvsDRBGLU4hpr4zsdffJdDD.Y0
            [user_nicename] => peterpanpan
            [user_email] => **********@gmail.com
            [user_url] => 
            [user_registered] => 2011-11-29 14:20:46
            [user_activation_key] => 
            [user_status] => 0
            [display_name] => Peter Pan
        )

    [1] => stdClass Object
        (
            [ID] => 11433
            [user_login] => peterpanpan
            [user_pass] => $P$B1SJOYhvsDRBGLU4hpr4zsdffJdDD.Y0
            [user_nicename] => peterpanpan
            [user_email] => **********@gmail.com
            [user_url] => 
            [user_registered] => 2011-11-29 14:20:46
            [user_activation_key] => 
            [user_status] => 0
            [display_name] => Peter Pan
        )

    [2] => stdClass Object
        (
            [ID] => 10663
            [user_login] => dmartin
            [user_pass] => $P$BLFk4yteiCQnVbyXMbMy4jOpBbytw3/
            [user_nicename] => enfont
            [user_email] => **********@yahoo.fr
            [user_url] => 
            [user_registered] => 2011-11-09 14:03:49
            [user_activation_key] => 
            [user_status] => 0
            [display_name] => Deanmartin
        )

)

In the example, $users[0] and $users[1] are exactly the same. In the database, there are no duplicates.

This started to happen recently, and the only thing that has been added was the W3 Total Cache plugin (but why would it cause such a behavior?). I tried deactivating it, but the duplicates remain.

Does anybody have a clue of what may be going on here ?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top