Ticket #25672: 25672.3.diff
File 25672.3.diff, 25.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-users-list-table.php
341 341 public function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) { 342 342 global $wp_roles; 343 343 344 if ( ! ( is_object( $user_object ) && is_a( $user_object, 'WP_User') ) )344 if ( ! ( is_object( $user_object ) && ( $user_object instanceof WP_User ) ) ) 345 345 $user_object = get_userdata( (int) $user_object ); 346 346 347 $user_object->filter = 'display'; 347 348 $email = $user_object->user_email; 348 349 -
src/wp-admin/includes/screen.php
375 375 */ 376 376 public static function get( $hook_name = '' ) { 377 377 378 if ( is_a( $hook_name, 'WP_Screen' ))378 if ( $hook_name instanceof WP_Screen ) 379 379 return $hook_name; 380 380 381 381 $post_type = $taxonomy = null; -
src/wp-admin/includes/template.php
169 169 170 170 $r = wp_parse_args( $params, $defaults ); 171 171 172 if ( empty( $r['walker'] ) || ! is_a( $r['walker'], 'Walker') ) {172 if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) { 173 173 $walker = new Walker_Category_Checklist; 174 174 } else { 175 175 $walker = $r['walker']; -
src/wp-admin/includes/theme.php
132 132 if ( !isset($themes_update) ) 133 133 $themes_update = get_site_transient('update_themes'); 134 134 135 if ( ! is_a( $theme, 'WP_Theme' ) )135 if ( ! ( $theme instanceof WP_Theme ) ) { 136 136 return false; 137 } 137 138 138 139 $stylesheet = $theme->get_stylesheet(); 139 140 -
src/wp-includes/Text/Diff/Renderer.php
83 83 /* If these are unchanged (copied) lines, and we want to keep 84 84 * leading or trailing context lines, extract them from the copy 85 85 * block. */ 86 if ( is_a($edit, 'Text_Diff_Op_copy')) {86 if ( $edit instanceof Text_Diff_Op_copy ) { 87 87 /* Do we have any diff blocks yet? */ 88 88 if (is_array($block)) { 89 89 /* How many lines to keep as context from the copy -
src/wp-includes/Text/Diff.php
74 74 { 75 75 $count = 0; 76 76 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 ) ) { 79 79 $count += $edit->nfinal(); 80 80 } 81 81 } … … 93 93 { 94 94 $count = 0; 95 95 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 ) ) { 98 98 $count += $edit->norig(); 99 99 } 100 100 } … … 137 137 function isEmpty() 138 138 { 139 139 foreach ($this->_edits as $edit) { 140 if ( !is_a($edit, 'Text_Diff_Op_copy')) {140 if ( ! ( $edit instanceof Text_Diff_Op_copy ) ) { 141 141 return false; 142 142 } 143 143 } … … 155 155 { 156 156 $lcs = 0; 157 157 foreach ($this->_edits as $edit) { 158 if ( is_a($edit, 'Text_Diff_Op_copy')) {158 if ( $edit instanceof Text_Diff_Op_copy ) { 159 159 $lcs += count($edit->orig); 160 160 } 161 161 } -
src/wp-includes/capabilities.php
509 509 ); 510 510 } 511 511 512 if ( is_a( $id, 'WP_User' )) {512 if ( $id instanceof WP_User ) { 513 513 $this->init( $id->data, $blog_id ); 514 514 return; 515 515 } elseif ( is_object( $id ) ) { -
src/wp-includes/category-template.php
857 857 function walk_category_tree() { 858 858 $args = func_get_args(); 859 859 // 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 ) 861 861 $walker = new Walker_Category; 862 862 else 863 863 $walker = $args[2]['walker']; … … 875 875 function walk_category_dropdown_tree() { 876 876 $args = func_get_args(); 877 877 // 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 ) 879 879 $walker = new Walker_CategoryDropdown; 880 880 else 881 881 $walker = $args[2]['walker']; -
src/wp-includes/class-IXR.php
82 82 } 83 83 84 84 // 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 ) ) { 86 86 return 'date'; 87 87 } 88 if ( is_object($this->data) && is_a($this->data, 'IXR_Base64')) {88 if ( is_object( $this->data ) && ( $this->data instanceof IXR_Base64 ) ) { 89 89 return 'base64'; 90 90 } 91 91 … … 417 417 $result = $this->call($this->message->methodName, $this->message->params); 418 418 419 419 // Is the result an error? 420 if ( is_a($result, 'IXR_Error')) {420 if ( $result instanceof IXR_Error ) { 421 421 $this->error($result); 422 422 } 423 423 … … 564 564 } else { 565 565 $result = $this->call($method, $params); 566 566 } 567 if ( is_a($result, 'IXR_Error')) {567 if ( $result instanceof IXR_Error ) { 568 568 $return[] = array( 569 569 'faultCode' => $result->code, 570 570 'faultString' => $result->message … … 1006 1006 break; 1007 1007 case 'date': 1008 1008 case 'dateTime.iso8601': 1009 if ( !is_a($arg, 'IXR_Date')) {1009 if ( ! ( $arg instanceof IXR_Date ) ) { 1010 1010 $ok = false; 1011 1011 } 1012 1012 break; -
src/wp-includes/class-feed.php
37 37 } 38 38 39 39 public function save($data) { 40 if ( is_a($data, 'SimplePie') )40 if ( $data instanceof SimplePie ) { 41 41 $data = $data->data; 42 } 42 43 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 ); 45 46 return true; 46 47 } 47 48 -
src/wp-includes/class-wp-customize-manager.php
659 659 * constructor. 660 660 */ 661 661 public function add_setting( $id, $args = array() ) { 662 if ( is_a( $id, 'WP_Customize_Setting' ))662 if ( $id instanceof WP_Customize_Setting ) 663 663 $setting = $id; 664 664 else 665 665 $setting = new WP_Customize_Setting( $this, $id, $args ); … … 747 747 * @param array $args Section arguments. 748 748 */ 749 749 public function add_section( $id, $args = array() ) { 750 if ( is_a( $id, 'WP_Customize_Section' ))750 if ( $id instanceof WP_Customize_Section ) 751 751 $section = $id; 752 752 else 753 753 $section = new WP_Customize_Section( $this, $id, $args ); … … 789 789 * constructor. 790 790 */ 791 791 public function add_control( $id, $args = array() ) { 792 if ( is_a( $id, 'WP_Customize_Control' ))792 if ( $id instanceof WP_Customize_Control ) 793 793 $control = $id; 794 794 else 795 795 $control = new WP_Customize_Control( $this, $id, $args ); -
src/wp-includes/class-wp-error.php
255 255 * @return bool True, if WP_Error. False, if not WP_Error. 256 256 */ 257 257 function is_wp_error($thing) { 258 if ( is_object($thing) && is_a($thing, 'WP_Error') )258 if ( is_object($thing) && ( $thing instanceof WP_Error ) ) 259 259 return true; 260 260 return false; 261 261 } -
src/wp-includes/class-wp-theme.php
273 273 // Set the parent, if we're a child theme. 274 274 if ( $this->template != $this->stylesheet ) { 275 275 // 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 ) { 277 277 $_child->parent = null; 278 278 $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) ); 279 279 $_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) ); -
src/wp-includes/compat.php
65 65 function json_encode( $string ) { 66 66 global $wp_json; 67 67 68 if ( ! is_a($wp_json, 'Services_JSON') ) {68 if ( ! ( $wp_json instanceof Services_JSON ) ) { 69 69 require_once( ABSPATH . WPINC . '/class-json.php' ); 70 70 $wp_json = new Services_JSON(); 71 71 } … … 78 78 function json_decode( $string, $assoc_array = false ) { 79 79 global $wp_json; 80 80 81 if ( ! is_a($wp_json, 'Services_JSON') ) {81 if ( ! ( $wp_json instanceof Services_JSON ) ) { 82 82 require_once( ABSPATH . WPINC . '/class-json.php' ); 83 83 $wp_json = new Services_JSON(); 84 84 } -
src/wp-includes/deprecated.php
2689 2689 if ( is_object($user) ) { 2690 2690 if ( !isset($user->ID) ) 2691 2691 $user->ID = 0; 2692 if ( ! is_a( $user, 'WP_User') ) {2692 if ( ! ( $user instanceof WP_User ) ) { 2693 2693 $vars = get_object_vars($user); 2694 2694 foreach ( array_keys($vars) as $field ) { 2695 2695 if ( is_string($user->$field) || is_numeric($user->$field) ) -
src/wp-includes/functions.wp-scripts.php
35 35 $handles = false; 36 36 37 37 global $wp_scripts; 38 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {38 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 39 39 if ( ! did_action( 'init' ) ) 40 40 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 41 41 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 72 72 */ 73 73 function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) { 74 74 global $wp_scripts; 75 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {75 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 76 76 if ( ! did_action( 'init' ) ) 77 77 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 78 78 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 112 112 */ 113 113 function wp_localize_script( $handle, $object_name, $l10n ) { 114 114 global $wp_scripts; 115 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {115 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 116 116 if ( ! did_action( 'init' ) ) 117 117 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 118 118 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 138 138 */ 139 139 function wp_deregister_script( $handle ) { 140 140 global $wp_scripts; 141 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {141 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 142 142 if ( ! did_action( 'init' ) ) 143 143 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 144 144 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 194 194 */ 195 195 function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) { 196 196 global $wp_scripts; 197 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {197 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 198 198 if ( ! did_action( 'init' ) ) 199 199 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 200 200 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 222 222 */ 223 223 function wp_dequeue_script( $handle ) { 224 224 global $wp_scripts; 225 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {225 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 226 226 if ( ! did_action( 'init' ) ) 227 227 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 228 228 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 247 247 */ 248 248 function wp_script_is( $handle, $list = 'enqueued' ) { 249 249 global $wp_scripts; 250 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {250 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 251 251 if ( ! did_action( 'init' ) ) 252 252 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 253 253 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); -
src/wp-includes/functions.wp-styles.php
34 34 do_action( 'wp_print_styles' ); 35 35 36 36 global $wp_styles; 37 if ( ! is_a( $wp_styles, 'WP_Styles') ) {37 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 38 38 if ( ! did_action( 'init' ) ) 39 39 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 40 40 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 67 67 */ 68 68 function wp_add_inline_style( $handle, $data ) { 69 69 global $wp_styles; 70 if ( ! is_a( $wp_styles, 'WP_Styles') ) {70 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 71 71 if ( ! did_action( 'init' ) ) 72 72 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 73 73 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 102 102 */ 103 103 function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) { 104 104 global $wp_styles; 105 if ( ! is_a( $wp_styles, 'WP_Styles') ) {105 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 106 106 if ( ! did_action( 'init' ) ) 107 107 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 108 108 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 124 124 */ 125 125 function wp_deregister_style( $handle ) { 126 126 global $wp_styles; 127 if ( ! is_a( $wp_styles, 'WP_Styles') ) {127 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 128 128 if ( ! did_action( 'init' ) ) 129 129 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 130 130 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 157 157 */ 158 158 function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) { 159 159 global $wp_styles; 160 if ( ! is_a( $wp_styles, 'WP_Styles') ) {160 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 161 161 if ( ! did_action( 'init' ) ) 162 162 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 163 163 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 183 183 */ 184 184 function wp_dequeue_style( $handle ) { 185 185 global $wp_styles; 186 if ( ! is_a( $wp_styles, 'WP_Styles') ) {186 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 187 187 if ( ! did_action( 'init' ) ) 188 188 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 189 189 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 207 207 */ 208 208 function wp_style_is( $handle, $list = 'enqueued' ) { 209 209 global $wp_styles; 210 if ( ! is_a( $wp_styles, 'WP_Styles') ) {210 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 211 211 if ( ! did_action( 'init' ) ) 212 212 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 213 213 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); -
src/wp-includes/general-template.php
2721 2721 */ 2722 2722 function wp_admin_css( $file = 'wp-admin', $force_echo = false ) { 2723 2723 global $wp_styles; 2724 if ( ! is_a($wp_styles, 'WP_Styles') )2724 if ( ! ( $wp_styles instanceof WP_Styles ) ) 2725 2725 $wp_styles = new WP_Styles(); 2726 2726 2727 2727 // For backward compatibility -
src/wp-includes/ms-functions.php
2037 2037 * @return bool 2038 2038 */ 2039 2039 function is_user_spammy( $user = null ) { 2040 if ( ! is_a( $user, 'WP_User') ) {2040 if ( ! ( $user instanceof WP_User ) ) { 2041 2041 if ( $user ) 2042 2042 $user = get_user_by( 'login', $user ); 2043 2043 else -
src/wp-includes/pluggable.php
261 261 global $phpmailer; 262 262 263 263 // (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 ) ) { 265 265 require_once ABSPATH . WPINC . '/class-phpmailer.php'; 266 266 require_once ABSPATH . WPINC . '/class-smtp.php'; 267 267 $phpmailer = new PHPMailer( true ); -
src/wp-includes/post.php
418 418 if ( empty( $post ) && isset( $GLOBALS['post'] ) ) 419 419 $post = $GLOBALS['post']; 420 420 421 if ( is_a( $post, 'WP_Post' )) {421 if ( $post instanceof WP_Post ) { 422 422 $_post = $post; 423 423 } elseif ( is_object( $post ) ) { 424 424 if ( empty( $post->filter ) ) { -
src/wp-includes/script-loader.php
773 773 do_action( 'wp_print_scripts' ); 774 774 } 775 775 776 if ( ! is_a($wp_scripts, 'WP_Scripts') )776 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) 777 777 $wp_scripts = new WP_Scripts(); 778 778 779 779 script_concat_settings(); … … 803 803 function print_footer_scripts() { 804 804 global $wp_scripts, $concatenate_scripts; 805 805 806 if ( ! is_a($wp_scripts, 'WP_Scripts') )806 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) 807 807 return array(); // No need to run if not instantiated. 808 808 809 809 script_concat_settings(); … … 872 872 873 873 global $wp_scripts; 874 874 875 if ( ! is_a($wp_scripts, 'WP_Scripts') )875 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) 876 876 return array(); // no need to run if nothing is queued 877 877 878 878 return print_head_scripts(); … … 927 927 function print_admin_styles() { 928 928 global $wp_styles, $concatenate_scripts; 929 929 930 if ( ! is_a($wp_styles, 'WP_Styles') )930 if ( ! ( $wp_styles instanceof WP_Styles ) ) 931 931 $wp_styles = new WP_Styles(); 932 932 933 933 script_concat_settings(); … … 957 957 function print_late_styles() { 958 958 global $wp_styles, $concatenate_scripts; 959 959 960 if ( ! is_a($wp_styles, 'WP_Styles') )960 if ( ! ( $wp_styles instanceof WP_Styles ) ) 961 961 return; 962 962 963 963 $wp_styles->do_concat = $concatenate_scripts; -
src/wp-includes/template.php
135 135 136 136 $templates = array(); 137 137 138 if ( is_a( $author, 'WP_User' )) {138 if ( $author instanceof WP_User ) { 139 139 $templates[] = "author-{$author->user_nicename}.php"; 140 140 $templates[] = "author-{$author->ID}.php"; 141 141 } -
src/wp-includes/user.php
112 112 * @return WP_User|WP_Error WP_User on success, WP_Error on failure. 113 113 */ 114 114 function wp_authenticate_username_password($user, $username, $password) { 115 if ( is_a( $user, 'WP_User' )) {115 if ( $user instanceof WP_User ) { 116 116 return $user; 117 117 } 118 118 … … 167 167 * @return WP_User|WP_Error WP_User on success, WP_Error on failure. 168 168 */ 169 169 function wp_authenticate_cookie($user, $username, $password) { 170 if ( is_a( $user, 'WP_User' )) {170 if ( $user instanceof WP_User ) { 171 171 return $user; 172 172 } 173 173 … … 202 202 * @return WP_User|WP_Error WP_User on success, WP_Error if the user is considered a spammer. 203 203 */ 204 204 function wp_authenticate_spam_check( $user ) { 205 if ( $user && is_a( $user, 'WP_User') && is_multisite() ) {205 if ( $user && ( $user instanceof WP_User ) && is_multisite() ) { 206 206 /** 207 207 * Filter whether the user has been marked as a spammer. 208 208 * … … 1636 1636 function wp_insert_user( $userdata ) { 1637 1637 global $wpdb; 1638 1638 1639 if ( is_a( $userdata, 'stdClass' )) {1639 if ( $userdata instanceof stdClass ) { 1640 1640 $userdata = get_object_vars( $userdata ); 1641 } elseif ( is_a( $userdata, 'WP_User' )) {1641 } elseif ( $userdata instanceof WP_User ) { 1642 1642 $userdata = $userdata->to_array(); 1643 1643 } 1644 1644 // Are we updating or creating? … … 1887 1887 * @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated. 1888 1888 */ 1889 1889 function wp_update_user($userdata) { 1890 if ( is_a( $userdata, 'stdClass' ) )1890 if ( $userdata instanceof stdClass ) { 1891 1891 $userdata = get_object_vars( $userdata ); 1892 elseif ( is_a( $userdata, 'WP_User' ) ) 1892 } 1893 elseif ( $userdata instanceof WP_User ) { 1893 1894 $userdata = $userdata->to_array(); 1895 } 1894 1896 1895 1897 $ID = (int) $userdata['ID']; 1896 1898 -
src/wp-includes/widgets.php
1354 1354 global $wp_widget_factory; 1355 1355 1356 1356 $widget_obj = $wp_widget_factory->widgets[$widget]; 1357 if ( ! is_a($widget_obj, 'WP_Widget') )1357 if ( ! ( $widget_obj instanceof WP_Widget ) ) 1358 1358 return; 1359 1359 1360 1360 $before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname'] );