Make WordPress Core

Ticket #25672: 25672.4.diff

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

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

     
    374374         */
    375375        public static function get( $hook_name = '' ) {
    376376
    377                 if ( is_a( $hook_name, 'WP_Screen' ) )
     377                if ( $hook_name instanceof WP_Screen ) {
    378378                        return $hook_name;
     379                }
    379380
    380381                $post_type = $taxonomy = null;
    381382                $in_admin = false;
  • src/wp-admin/includes/template.php

     
    176176
    177177        $r = wp_parse_args( $params, $defaults );
    178178
    179         if ( empty( $r['walker'] ) || ! is_a( $r['walker'], 'Walker' ) ) {
     179        if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) {
    180180                $walker = new Walker_Category_Checklist;
    181181        } else {
    182182                $walker = $r['walker'];
  • src/wp-admin/includes/theme.php

     
    149149        if ( !isset($themes_update) )
    150150                $themes_update = get_site_transient('update_themes');
    151151
    152         if ( ! is_a( $theme, 'WP_Theme' ) )
     152        if ( ! ( $theme instanceof WP_Theme ) ) {
    153153                return false;
     154        }
    154155
    155156        $stylesheet = $theme->get_stylesheet();
    156157
  • src/wp-includes/capabilities.php

     
    520520                        );
    521521                }
    522522
    523                 if ( is_a( $id, 'WP_User' ) ) {
     523                if ( $id instanceof WP_User ) {
    524524                        $this->init( $id->data, $blog_id );
    525525                        return;
    526526                } elseif ( is_object( $id ) ) {
  • src/wp-includes/category-template.php

     
    882882function walk_category_tree() {
    883883        $args = func_get_args();
    884884        // the user's options are the third parameter
    885         if ( empty($args[2]['walker']) || !is_a($args[2]['walker'], 'Walker') )
     885        if ( empty( $args[2]['walker'] ) || ! ( $args[2]['walker'] instanceof Walker ) ) {
    886886                $walker = new Walker_Category;
    887         else
     887        } else {
    888888                $walker = $args[2]['walker'];
    889 
     889        }
    890890        return call_user_func_array(array( &$walker, 'walk' ), $args );
    891891}
    892892
  • 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
    4344                set_transient($this->name, $data, $this->lifetime);
    4445                set_transient($this->mod_name, time(), $this->lifetime);
  • src/wp-includes/class-wp-customize-manager.php

     
    695695         *                                        constructor.
    696696         */
    697697        public function add_setting( $id, $args = array() ) {
    698                 if ( is_a( $id, 'WP_Customize_Setting' ) )
     698                if ( $id instanceof WP_Customize_Setting ) {
    699699                        $setting = $id;
    700                 else
     700                } else {
    701701                        $setting = new WP_Customize_Setting( $this, $id, $args );
    702 
     702                }
    703703                $this->settings[ $setting->id ] = $setting;
    704704        }
    705705
     
    737737         * @param array                     $args Optional. Panel arguments. Default empty array.
    738738         */
    739739        public function add_panel( $id, $args = array() ) {
    740                 if ( is_a( $id, 'WP_Customize_Panel' ) ) {
     740                if ( $id instanceof WP_Customize_Panel ) {
    741741                        $panel = $id;
    742                 }
    743                 else {
     742                } else {
    744743                        $panel = new WP_Customize_Panel( $this, $id, $args );
    745744                }
    746745
     
    783782         * @param array                       $args Section arguments.
    784783         */
    785784        public function add_section( $id, $args = array() ) {
    786                 if ( is_a( $id, 'WP_Customize_Section' ) )
     785                if ( $id instanceof WP_Customize_Section ) {
    787786                        $section = $id;
    788                 else
     787                } else {
    789788                        $section = new WP_Customize_Section( $this, $id, $args );
    790 
     789                }
    791790                $this->sections[ $section->id ] = $section;
    792791        }
    793792
     
    825824         *                                          constructor.
    826825         */
    827826        public function add_control( $id, $args = array() ) {
    828                 if ( is_a( $id, 'WP_Customize_Control' ) )
     827                if ( $id instanceof WP_Customize_Control ) {
    829828                        $control = $id;
    830                 else
     829                } else {
    831830                        $control = new WP_Customize_Control( $this, $id, $args );
    832 
     831                }
    833832                $this->controls[ $control->id ] = $control;
    834833        }
    835834
  • src/wp-includes/class-wp-error.php

     
    214214 * @param mixed $thing Check if unknown variable is a WP_Error object.
    215215 * @return bool True, if WP_Error. False, if not WP_Error.
    216216 */
    217 function is_wp_error($thing) {
    218         if ( is_object($thing) && is_a($thing, 'WP_Error') )
    219                 return true;
    220         return false;
     217function is_wp_error( $thing ) {
     218        return ( $thing instanceof WP_Error );
    221219}
  • src/wp-includes/class-wp-theme.php

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

     
    11171117                        return $this->error;
    11181118
    11191119                // convert the date field back to IXR form
    1120                 if ( isset( $content_struct['post_date'] ) && ! is_a( $content_struct['post_date'], 'IXR_Date' ) ) {
     1120                if ( isset( $content_struct['post_date'] ) && ! ( $content_struct['post_date'] instanceof IXR_Date ) ) {
    11211121                        $content_struct['post_date'] = $this->_convert_date( $content_struct['post_date'] );
    11221122                }
    11231123
    11241124                // ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct,
    11251125                // since _insert_post will ignore the non-GMT date if the GMT date is set
    1126                 if ( isset( $content_struct['post_date_gmt'] ) && ! is_a( $content_struct['post_date_gmt'], 'IXR_Date' ) ) {
     1126                if ( isset( $content_struct['post_date_gmt'] ) && ! ( $content_struct['post_date_gmt'] instanceof IXR_Date ) ) {
    11271127                        if ( $content_struct['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) ) {
    11281128                                unset( $content_struct['post_date_gmt'] );
    11291129                        } else {
  • 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

     
    26842684        if ( is_object($user) ) {
    26852685                if ( !isset($user->ID) )
    26862686                        $user->ID = 0;
    2687                 if ( !is_a( $user, 'WP_User' ) ) {
     2687                if ( ! ( $user instanceof WP_User ) ) {
    26882688                        $vars = get_object_vars($user);
    26892689                        foreach ( array_keys($vars) as $field ) {
    26902690                                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' );
     
    115115 */
    116116function wp_localize_script( $handle, $object_name, $l10n ) {
    117117        global $wp_scripts;
    118         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     118        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    119119                if ( ! did_action( 'init' ) )
    120120                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    121121                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    141141 */
    142142function wp_deregister_script( $handle ) {
    143143        global $wp_scripts;
    144         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     144        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    145145                if ( ! did_action( 'init' ) )
    146146                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    147147                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    197197 */
    198198function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) {
    199199        global $wp_scripts;
    200         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     200        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    201201                if ( ! did_action( 'init' ) )
    202202                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    203203                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    229229 */
    230230function wp_dequeue_script( $handle ) {
    231231        global $wp_scripts;
    232         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     232        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    233233                if ( ! did_action( 'init' ) )
    234234                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    235235                                '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
     
    254254 */
    255255function wp_script_is( $handle, $list = 'enqueued' ) {
    256256        global $wp_scripts;
    257         if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
     257        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    258258                if ( ! did_action( 'init' ) )
    259259                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
    260260                                '<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

     
    28492849 */
    28502850function wp_admin_css( $file = 'wp-admin', $force_echo = false ) {
    28512851        global $wp_styles;
    2852         if ( !is_a($wp_styles, 'WP_Styles') )
     2852        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    28532853                $wp_styles = new WP_Styles();
     2854        }
    28542855
    28552856        // For backward compatibility
    28562857        $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file;
  • src/wp-includes/ms-functions.php

     
    20052005 * @return bool
    20062006 */
    20072007function is_user_spammy( $user = null ) {
    2008     if ( ! is_a( $user, 'WP_User' ) ) {
    2009                 if ( $user )
     2008    if ( ! ( $user instanceof WP_User ) ) {
     2009                if ( $user ) {
    20102010                        $user = get_user_by( 'login', $user );
    2011                 else
     2011                } else {
    20122012                        $user = wp_get_current_user();
     2013                }
    20132014        }
    20142015
    20152016        return $user && isset( $user->spam ) && 1 == $user->spam;
  • src/wp-includes/pluggable.php

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

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

     
    778778                do_action( 'wp_print_scripts' );
    779779        }
    780780
    781         if ( !is_a($wp_scripts, 'WP_Scripts') )
     781        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    782782                $wp_scripts = new WP_Scripts();
     783        }
    783784
    784785        script_concat_settings();
    785786        $wp_scripts->do_concat = $concatenate_scripts;
     
    808809function print_footer_scripts() {
    809810        global $wp_scripts, $concatenate_scripts;
    810811
    811         if ( !is_a($wp_scripts, 'WP_Scripts') )
     812        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    812813                return array(); // No need to run if not instantiated.
    813 
     814        }
    814815        script_concat_settings();
    815816        $wp_scripts->do_concat = $concatenate_scripts;
    816817        $wp_scripts->do_footer_items();
     
    892893
    893894        global $wp_scripts;
    894895
    895         if ( !is_a($wp_scripts, 'WP_Scripts') )
     896        if ( ! ( $wp_scripts instanceof WP_Scripts ) ) {
    896897                return array(); // no need to run if nothing is queued
    897 
     898        }
    898899        return print_head_scripts();
    899900}
    900901
     
    947948function print_admin_styles() {
    948949        global $wp_styles, $concatenate_scripts;
    949950
    950         if ( !is_a($wp_styles, 'WP_Styles') )
     951        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    951952                $wp_styles = new WP_Styles();
     953        }
    952954
    953955        script_concat_settings();
    954956        $wp_styles->do_concat = $concatenate_scripts;
     
    977979function print_late_styles() {
    978980        global $wp_styles, $concatenate_scripts;
    979981
    980         if ( !is_a($wp_styles, 'WP_Styles') )
     982        if ( ! ( $wp_styles instanceof WP_Styles ) ) {
    981983                return;
     984        }
    982985
    983986        $wp_styles->do_concat = $concatenate_scripts;
    984987        $wp_styles->do_footer_items();
  • 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/theme.php

     
    20272027function is_customize_preview() {
    20282028        global $wp_customize;
    20292029
    2030         return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
     2030        return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview();
    20312031}
  • 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 instanceof WP_User && is_multisite() ) {
    206206                /**
    207207                 * Filter whether the user has been marked as a spammer.
    208208                 *
     
    17101710function wp_insert_user( $userdata ) {
    17111711        global $wpdb;
    17121712
    1713         if ( is_a( $userdata, 'stdClass' ) ) {
     1713        if ( $userdata instanceof stdClass ) {
    17141714                $userdata = get_object_vars( $userdata );
    1715         } elseif ( is_a( $userdata, 'WP_User' ) ) {
     1715        } elseif ( $userdata instanceof WP_User ) {
    17161716                $userdata = $userdata->to_array();
    17171717        }
    17181718        // Are we updating or creating?
     
    19691969 * @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated.
    19701970 */
    19711971function wp_update_user($userdata) {
    1972         if ( is_a( $userdata, 'stdClass' ) )
     1972        if ( $userdata instanceof stdClass ) {
    19731973                $userdata = get_object_vars( $userdata );
    1974         elseif ( is_a( $userdata, 'WP_User' ) )
     1974        } elseif ( $userdata instanceof WP_User ) {
    19751975                $userdata = $userdata->to_array();
     1976        }
    19761977
    19771978        $ID = (int) $userdata['ID'];
    19781979
  • src/wp-includes/widgets.php

     
    15521552        global $wp_widget_factory;
    15531553
    15541554        $widget_obj = $wp_widget_factory->widgets[$widget];
    1555         if ( !is_a($widget_obj, 'WP_Widget') )
     1555        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
    15561556                return;
     1557        }
    15571558
    15581559        $before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname'] );
    15591560        $default_args = array( 'before_widget' => $before_widget, 'after_widget' => "</div>", 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>' );