[resolved] get_users_of_blog() changed in 3.1 (3 posts)

  1. Marcel Brinkkemper
    Posted 5 years ago #

    up until now this would work in my plugin:

    $blogusers = get_users_of_blog();
    foreach( $blogusers as $user ) {
      if $user->has_cap( 'whatever' )

    Are the items returned not class WP_User anymore?
    Is it a bug or was I just lucky it did work before?

  2. Dion Hulse
    Lead Developer
    Posted 5 years ago #

    This did indeed change in 3.1: http://core.trac.wordpress.org/ticket/15854

    However, It did get reverted to 3.0's code: http://core.trac.wordpress.org/changeset/17084

    But that code by itself will not work at all, as WP_User objects are not returned, just the database rows..

  3. Marcel Brinkkemper
    Posted 5 years ago #

    Thanks for clarifying. I'll better use WP_User_Query.

Topic Closed

This topic has been closed to new replies.

About this Topic