WordPress.org

Ready to get started?Download WordPress

Forums

is_a() causing errors with get_users() (3 posts)

  1. dgdax
    Member
    Posted 8 months ago #

    Running WordPress with Yii framework sub-site.
    Use of is_a() function in capabilities.php (line 486) is causing errors, since causes instantiation of a WP_User object - which is unknown to Yii.

    is_a() was deprecated in PHP 5.0.0 - but did not cause this problem until PHP 5.3.7, when its behaviour changed: if first argument is not an object, __autoload() is triggered. (see php manual)

    Example: error if I use get_users() with the 'all_with_meta' option.

    This is at least inefficient - and in my situation fatal! Even when it works, this generates unnecessary log warnings in many cases (see all the other posts)

    Solution:
    replace: if ( is_a( $id, 'WP_User' ) )
    with: if ( $id instanceof WP_User )

    Please can you fix this for increased compatibility in future versions - both with PHP and all the other plugins!

  2. Thanks for the information. It would be very helpful if you could file this as a bug report on the WordPress bug tracker, http://core.trac.wordpress.org/newticket so that it can be investigated further.

  3. dgdax
    Member
    Posted 8 months ago #

    Thanks Chris - I was trying to raise it as a bug, but didn't find the link... Also feel better about doing it on your advice!

Reply

You must log in to post.

About this Topic