Make WordPress Core

Ticket #25672: 25672.3.diff

File 25672.3.diff, 25.2 KB (added by markoheijnen, 10 years ago)
  • src/wp-admin/includes/class-wp-users-list-table.php

     
    341341        public function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) {
    342342                global $wp_roles;
    343343
    344                 if ( !( is_object( $user_object ) && is_a( $user_object, 'WP_User' ) ) )
     344                if ( ! ( is_object( $user_object ) && ( $user_object instanceof WP_User ) ) )
    345345                        $user_object = get_userdata( (int) $user_object );
     346
    346347                $user_object->filter = 'display';
    347348                $email = $user_object->user_email;
    348349
  • src/wp-admin/includes/screen.php

     
    375375         */
    376376        public static function get( $hook_name = '' ) {
    377377
    378                 if ( is_a( $hook_name, 'WP_Screen' ) )
     378                if ( $hook_name instanceof WP_Screen )
    379379                        return $hook_name;
    380380
    381381                $post_type = $taxonomy = null;
  • src/wp-admin/includes/template.php

     
    169169
    170170        $r = wp_parse_args( $params, $defaults );
    171171
    172         if ( empty( $r['walker'] ) || ! is_a( $r['walker'], 'Walker' ) ) {
     172        if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) {
    173173                $walker = new Walker_Category_Checklist;
    174174        } else {
    175175                $walker = $r['walker'];
  • src/wp-admin/includes/theme.php

     
    132132        if ( !isset($themes_update) )
    133133                $themes_update = get_site_transient('update_themes');
    134134
    135         if ( ! is_a( $theme, 'WP_Theme' ) )
     135        if ( ! ( $theme instanceof WP_Theme ) ) {
    136136                return false;
     137        }
    137138
    138139        $stylesheet = $theme->get_stylesheet();
    139140
  • src/wp-includes/Text/Diff/Renderer.php

     
    8383            /* If these are unchanged (copied) lines, and we want to keep
    8484             * leading or trailing context lines, extract them from the copy
    8585             * block. */
    86             if (is_a($edit, 'Text_Diff_Op_copy')) {
     86            if ( $edit instanceof Text_Diff_Op_copy ) {
    8787                /* Do we have any diff blocks yet? */
    8888                if (is_array($block)) {
    8989                    /* How many lines to keep as context from the copy
  • src/wp-includes/Text/Diff.php

     
    7474    {
    7575        $count = 0;
    7676        foreach ($this->_edits as $edit) {
    77             if (is_a($edit, 'Text_Diff_Op_add') ||
    78                 is_a($edit, 'Text_Diff_Op_change')) {
     77            if ( ( $edit instanceof Text_Diff_Op_add ) ||
     78                ( $edit instanceof Text_Diff_Op_change ) ) {
    7979                $count += $edit->nfinal();
    8080            }
    8181        }
     
    9393    {
    9494        $count = 0;
    9595        foreach ($this->_edits as $edit) {
    96             if (is_a($edit, 'Text_Diff_Op_delete') ||
    97                 is_a($edit, 'Text_Diff_Op_change')) {
     96            if ( ( $edit instanceof Text_Diff_Op_delete ) ||
     97                ( $edit instanceof Text_Diff_Op_change ) ) {
    9898                $count += $edit->norig();
    9999            }
    100100        }
     
    137137    function isEmpty()
    138138    {
    139139        foreach ($this->_edits as $edit) {
    140             if (!is_a($edit, 'Text_Diff_Op_copy')) {
     140            if ( ! ( $edit instanceof Text_Diff_Op_copy ) ) {
    141141                return false;
    142142            }
    143143        }
     
    155155    {
    156156        $lcs = 0;
    157157        foreach ($this->_edits as $edit) {
    158             if (is_a($edit, 'Text_Diff_Op_copy')) {
     158            if ( $edit instanceof Text_Diff_Op_copy ) {
    159159                $lcs += count($edit->orig);
    160160            }
    161161        }
  • src/wp-includes/capabilities.php

     
    509509                        );
    510510                }
    511511
    512                 if ( is_a( $id, 'WP_User' ) ) {
     512                if ( $id instanceof WP_User ) {
    513513                        $this->init( $id->data, $blog_id );
    514514                        return;
    515515                } elseif ( is_object( $id ) ) {
  • src/wp-includes/category-template.php

     
    857857function walk_category_tree() {
    858858        $args = func_get_args();
    859859        // the user's options are the third parameter
    860         if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
     860        if ( empty( $args[2]['walker'] ) || ! $args[2]['walker'] instanceof Walker )
    861861                $walker = new Walker_Category;
    862862        else
    863863                $walker = $args[2]['walker'];
     
    875875function walk_category_dropdown_tree() {
    876876        $args = func_get_args();
    877877        // the user's options are the third parameter
    878         if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
     878        if ( empty( $args[2]['walker'] ) || ! $args[2]['walker'] instanceof Walker )
    879879                $walker = new Walker_CategoryDropdown;
    880880        else
    881881                $walker = $args[2]['walker'];
  • src/wp-includes/class-IXR.php

     
    8282        }
    8383
    8484        // Deal with IXR object types base64 and date
    85         if (is_object($this->data) && is_a($this->data, 'IXR_Date')) {
     85        if ( is_object( $this->data ) && ( $this->data instanceof IXR_Date ) ) {
    8686            return 'date';
    8787        }
    88         if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) {
     88        if ( is_object( $this->data ) && ( $this->data instanceof IXR_Base64 ) ) {
    8989            return 'base64';
    9090        }
    9191
     
    417417        $result = $this->call($this->message->methodName, $this->message->params);
    418418
    419419        // Is the result an error?
    420         if (is_a($result, 'IXR_Error')) {
     420        if ( $result instanceof IXR_Error ) {
    421421            $this->error($result);
    422422        }
    423423
     
    564564            } else {
    565565                $result = $this->call($method, $params);
    566566            }
    567             if (is_a($result, 'IXR_Error')) {
     567            if ( $result instanceof IXR_Error ) {
    568568                $return[] = array(
    569569                    'faultCode' => $result->code,
    570570                    'faultString' => $result->message
     
    10061006                    break;
    10071007                case 'date':
    10081008                case 'dateTime.iso8601':
    1009                     if (!is_a($arg, 'IXR_Date')) {
     1009                    if ( ! ( $arg instanceof IXR_Date ) ) {
    10101010                        $ok = false;
    10111011                    }
    10121012                    break;
  • src/wp-includes/class-feed.php

     
    3737        }
    3838
    3939        public function save($data) {
    40                 if ( is_a($data, 'SimplePie') )
     40                if ( $data instanceof SimplePie ) {
    4141                        $data = $data->data;
     42                }
    4243
    43                 set_transient($this->name, $data, $this->lifetime);
    44                 set_transient($this->mod_name, time(), $this->lifetime);
     44                set_transient( $this->name, $data, $this->lifetime );
     45                set_transient( $this->mod_name, time(), $this->lifetime );
    4546                return true;
    4647        }
    4748
  • src/wp-includes/class-wp-customize-manager.php

     
    659659         *                                        constructor.
    660660         */
    661661        public function add_setting( $id, $args = array() ) {
    662                 if ( is_a( $id, 'WP_Customize_Setting' ) )
     662                if ( $id instanceof WP_Customize_Setting )
    663663                        $setting = $id;
    664664                else
    665665                        $setting = new WP_Customize_Setting( $this, $id, $args );
     
    747747         * @param array                       $args Section arguments.
    748748         */
    749749        public function add_section( $id, $args = array() ) {
    750                 if ( is_a( $id, 'WP_Customize_Section' ) )
     750                if ( $id instanceof WP_Customize_Section )
    751751                        $section = $id;
    752752                else
    753753                        $section = new WP_Customize_Section( $this, $id, $args );
     
    789789         *                                          constructor.
    790790         */
    791791        public function add_control( $id, $args = array() ) {
    792                 if ( is_a( $id, 'WP_Customize_Control' ) )
     792                if ( $id instanceof WP_Customize_Control )
    793793                        $control = $id;
    794794                else
    795795                        $control = new WP_Customize_Control( $this, $id, $args );
  • src/wp-includes/class-wp-error.php

     
    255255 * @return bool True, if WP_Error. False, if not WP_Error.
    256256 */
    257257function is_wp_error($thing) {
    258         if ( is_object($thing) && is_a($thing, 'WP_Error') )
     258        if ( is_object($thing) && ( $thing instanceof WP_Error ) )
    259259                return true;
    260260        return false;
    261261}
  • src/wp-includes/class-wp-theme.php

     
    273273                // Set the parent, if we're a child theme.
    274274                if ( $this->template != $this->stylesheet ) {
    275275                        // If we are a parent, then there is a problem. Only two generations allowed! Cancel things out.
    276                         if ( is_a( $_child, 'WP_Theme' ) && $_child->template == $this->stylesheet ) {
     276                        if ( ( $_child instanceof WP_Theme ) && $_child->template == $this->stylesheet ) {
    277277                                $_child->parent = null;
    278278                                $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) );
    279279                                $_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) );
  • src/wp-includes/compat.php

     
    6565        function json_encode( $string ) {
    6666                global $wp_json;
    6767
    68                 if ( !is_a($wp_json, 'Services_JSON') ) {
     68                if ( ! ( $wp_json instanceof Services_JSON ) ) {
    6969                        require_once( ABSPATH . WPINC . '/class-json.php' );
    7070                        $wp_json = new Services_JSON();
    7171                }
     
    7878        function json_decode( $string, $assoc_array = false ) {
    7979                global $wp_json;
    8080
    81                 if ( !is_a($wp_json, 'Services_JSON') ) {
     81                if ( ! ( $wp_json instanceof Services_JSON ) ) {
    8282                        require_once( ABSPATH . WPINC . '/class-json.php' );
    8383                        $wp_json = new Services_JSON();
    8484                }
  • src/wp-includes/deprecated.php

     
    26892689        if ( is_object($user) ) {
    26902690                if ( !isset($user->ID) )
    26912691                        $user->ID = 0;
    2692                 if ( !is_a( $user, 'WP_User' ) ) {
     2692                if ( ! ( $user instanceof WP_User ) ) {
    26932693                        $vars = get_object_vars($user);
    26942694                        foreach ( array_keys($vars) as $field ) {
    26952695                                if ( is_string($user->$field) || is_numeric($user->$field) )
  • src/wp-includes/functions.wp-scripts.php

     
    3535                $handles = false;
    3636
    3737        global $wp_scripts;
    38         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     38        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    3939                if ( ! did_action( 'init' ) )
    4040                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    4141                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    7272 */
    7373function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
    7474        global $wp_scripts;
    75         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     75        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    7676                if ( ! did_action( 'init' ) )
    7777                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    7878                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    112112 */
    113113function wp_localize_script( $handle, $object_name, $l10n ) {
    114114        global $wp_scripts;
    115         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     115        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    116116                if ( ! did_action( 'init' ) )
    117117                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    118118                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    138138 */
    139139function wp_deregister_script( $handle ) {
    140140        global $wp_scripts;
    141         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     141        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    142142                if ( ! did_action( 'init' ) )
    143143                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    144144                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    194194 */
    195195function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
    196196        global $wp_scripts;
    197         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     197        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    198198                if ( ! did_action( 'init' ) )
    199199                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    200200                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    222222 */
    223223function wp_dequeue_script( $handle ) {
    224224        global $wp_scripts;
    225         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     225        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    226226                if ( ! did_action( 'init' ) )
    227227                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    228228                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    247247 */
    248248function wp_script_is( $handle, $list = 'enqueued' ) {
    249249        global $wp_scripts;
    250         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     250        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    251251                if ( ! did_action( 'init' ) )
    252252                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    253253                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
  • src/wp-includes/functions.wp-styles.php

     
    3434                do_action( 'wp_print_styles' );
    3535
    3636        global $wp_styles;
    37         if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
     37        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    3838                if ( ! did_action( 'init' ) )
    3939                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    4040                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    6767 */
    6868function wp_add_inline_style( $handle, $data ) {
    6969        global $wp_styles;
    70         if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
     70        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    7171                if ( ! did_action( 'init' ) )
    7272                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    7373                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    102102 */
    103103function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) {
    104104        global $wp_styles;
    105         if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
     105        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    106106                if ( ! did_action( 'init' ) )
    107107                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    108108                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    124124 */
    125125function wp_deregister_style( $handle ) {
    126126        global $wp_styles;
    127         if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
     127        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    128128                if ( ! did_action( 'init' ) )
    129129                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    130130                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    157157 */
    158158function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) {
    159159        global $wp_styles;
    160         if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
     160        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    161161                if ( ! did_action( 'init' ) )
    162162                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    163163                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    183183 */
    184184function wp_dequeue_style( $handle ) {
    185185        global $wp_styles;
    186         if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
     186        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    187187                if ( ! did_action( 'init' ) )
    188188                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    189189                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    207207 */
    208208function wp_style_is( $handle, $list = 'enqueued' ) {
    209209        global $wp_styles;
    210         if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
     210        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    211211                if ( ! did_action( 'init' ) )
    212212                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    213213                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
  • src/wp-includes/general-template.php

     
    27212721 */
    27222722function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
    27232723        global $wp_styles;
    2724         if ( !is_a($wp_styles, 'WP_Styles') )
     2724        if ( ! ( $wp_styles instanceof WP_Styles ) )
    27252725                $wp_styles = new WP_Styles();
    27262726
    27272727        // For backward compatibility
  • src/wp-includes/ms-functions.php

     
    20372037 * @return bool
    20382038 */
    20392039function is_user_spammy( $user = null ) {
    2040     if ( ! is_a( $user, 'WP_User' ) ) {
     2040    if ( ! ( $user instanceof WP_User ) ) {
    20412041                if ( $user )
    20422042                        $user = get_user_by( 'login', $user );
    20432043                else
  • src/wp-includes/pluggable.php

     
    261261        global $phpmailer;
    262262
    263263        // (Re)create it, if it's gone missing
    264         if ( !is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer' ) ) {
     264        if ( !is_object( $phpmailer ) || ! ( $phpmailer instanceof PHPMailer ) ) {
    265265                require_once ABSPATH . WPINC . '/class-phpmailer.php';
    266266                require_once ABSPATH . WPINC . '/class-smtp.php';
    267267                $phpmailer = new PHPMailer( true );
  • src/wp-includes/post.php

     
    418418        if ( empty( $post ) && isset( $GLOBALS['post'] ) )
    419419                $post = $GLOBALS['post'];
    420420
    421         if ( is_a( $post, 'WP_Post' ) ) {
     421        if ( $post instanceof WP_Post ) {
    422422                $_post = $post;
    423423        } elseif ( is_object( $post ) ) {
    424424                if ( empty( $post->filter ) ) {
  • src/wp-includes/script-loader.php

     
    773773                do_action( 'wp_print_scripts' );
    774774        }
    775775
    776         if ( !is_a($wp_scripts, 'WP_Scripts') )
     776        if ( ! ( $wp_scripts instanceof WP_Scripts ) )
    777777                $wp_scripts = new WP_Scripts();
    778778
    779779        script_concat_settings();
     
    803803function print_footer_scripts() {
    804804        global $wp_scripts, $concatenate_scripts;
    805805
    806         if ( !is_a($wp_scripts, 'WP_Scripts') )
     806        if ( ! ( $wp_scripts instanceof WP_Scripts ) )
    807807                return array(); // No need to run if not instantiated.
    808808
    809809        script_concat_settings();
     
    872872
    873873        global $wp_scripts;
    874874
    875         if ( !is_a($wp_scripts, 'WP_Scripts') )
     875        if ( ! ( $wp_scripts instanceof WP_Scripts ) )
    876876                return array(); // no need to run if nothing is queued
    877877
    878878        return print_head_scripts();
     
    927927function print_admin_styles() {
    928928        global $wp_styles, $concatenate_scripts;
    929929
    930         if ( !is_a($wp_styles, 'WP_Styles') )
     930        if ( ! ( $wp_styles instanceof WP_Styles ) )
    931931                $wp_styles = new WP_Styles();
    932932
    933933        script_concat_settings();
     
    957957function print_late_styles() {
    958958        global $wp_styles, $concatenate_scripts;
    959959
    960         if ( !is_a($wp_styles, 'WP_Styles') )
     960        if ( ! ( $wp_styles instanceof WP_Styles ) )
    961961                return;
    962962
    963963        $wp_styles->do_concat = $concatenate_scripts;
  • src/wp-includes/template.php

     
    135135
    136136        $templates = array();
    137137
    138         if ( is_a( $author, 'WP_User' ) ) {
     138        if ( $author instanceof WP_User ) {
    139139                $templates[] = "author-{$author->user_nicename}.php";
    140140                $templates[] = "author-{$author->ID}.php";
    141141        }
  • src/wp-includes/user.php

     
    112112 * @return WP_User|WP_Error WP_User on success, WP_Error on failure.
    113113 */
    114114function wp_authenticate_username_password($user, $username, $password) {
    115         if ( is_a( $user, 'WP_User' ) ) {
     115        if ( $user instanceof WP_User ) {
    116116                return $user;
    117117        }
    118118
     
    167167 * @return WP_User|WP_Error WP_User on success, WP_Error on failure.
    168168 */
    169169function wp_authenticate_cookie($user, $username, $password) {
    170         if ( is_a( $user, 'WP_User' ) ) {
     170        if ( $user instanceof WP_User ) {
    171171                return $user;
    172172        }
    173173
     
    202202 * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer.
    203203 */
    204204function wp_authenticate_spam_check( $user ) {
    205         if ( $user && is_a( $user, 'WP_User' ) && is_multisite() ) {
     205        if ( $user && ( $user instanceof WP_User ) && is_multisite() ) {
    206206                /**
    207207                 * Filter whether the user has been marked as a spammer.
    208208                 *
     
    16361636function wp_insert_user( $userdata ) {
    16371637        global $wpdb;
    16381638
    1639         if ( is_a( $userdata, 'stdClass' ) ) {
     1639        if ( $userdata instanceof stdClass ) {
    16401640                $userdata = get_object_vars( $userdata );
    1641         } elseif ( is_a( $userdata, 'WP_User' ) ) {
     1641        } elseif ( $userdata instanceof WP_User ) {
    16421642                $userdata = $userdata->to_array();
    16431643        }
    16441644        // Are we updating or creating?
     
    18871887 * @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated.
    18881888 */
    18891889function wp_update_user($userdata) {
    1890         if ( is_a( $userdata, 'stdClass' ) )
     1890        if ( $userdata instanceof stdClass ) {
    18911891                $userdata = get_object_vars( $userdata );
    1892         elseif ( is_a( $userdata, 'WP_User' ) )
     1892        }
     1893        elseif ( $userdata instanceof WP_User ) {
    18931894                $userdata = $userdata->to_array();
     1895        }
    18941896
    18951897        $ID = (int) $userdata['ID'];
    18961898
  • src/wp-includes/widgets.php

     
    13541354        global $wp_widget_factory;
    13551355
    13561356        $widget_obj = $wp_widget_factory->widgets[$widget];
    1357         if ( !is_a($widget_obj, 'WP_Widget') )
     1357        if ( ! ( $widget_obj instanceof WP_Widget ) )
    13581358                return;
    13591359
    13601360        $before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname'] );