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

  1. dgdax
    Posted 1 year 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)

    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
    Posted 1 year 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!

Topic Closed

This topic has been closed to new replies.

About this Topic