Ticket #25672: 25672.4.diff
File 25672.4.diff, 23.9 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-users-list-table.php
339 339 public function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) { 340 340 global $wp_roles; 341 341 342 if ( ! ( is_object( $user_object ) && is_a( $user_object, 'WP_User' ) ) )342 if ( ! ( $user_object instanceof WP_User ) ) { 343 343 $user_object = get_userdata( (int) $user_object ); 344 } 344 345 $user_object->filter = 'display'; 345 346 $email = $user_object->user_email; 346 347 -
src/wp-admin/includes/screen.php
374 374 */ 375 375 public static function get( $hook_name = '' ) { 376 376 377 if ( is_a( $hook_name, 'WP_Screen' ) )377 if ( $hook_name instanceof WP_Screen ) { 378 378 return $hook_name; 379 } 379 380 380 381 $post_type = $taxonomy = null; 381 382 $in_admin = false; -
src/wp-admin/includes/template.php
176 176 177 177 $r = wp_parse_args( $params, $defaults ); 178 178 179 if ( empty( $r['walker'] ) || ! is_a( $r['walker'], 'Walker') ) {179 if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) { 180 180 $walker = new Walker_Category_Checklist; 181 181 } else { 182 182 $walker = $r['walker']; -
src/wp-admin/includes/theme.php
149 149 if ( !isset($themes_update) ) 150 150 $themes_update = get_site_transient('update_themes'); 151 151 152 if ( ! is_a( $theme, 'WP_Theme' ) )152 if ( ! ( $theme instanceof WP_Theme ) ) { 153 153 return false; 154 } 154 155 155 156 $stylesheet = $theme->get_stylesheet(); 156 157 -
src/wp-includes/capabilities.php
520 520 ); 521 521 } 522 522 523 if ( is_a( $id, 'WP_User' )) {523 if ( $id instanceof WP_User ) { 524 524 $this->init( $id->data, $blog_id ); 525 525 return; 526 526 } elseif ( is_object( $id ) ) { -
src/wp-includes/category-template.php
882 882 function walk_category_tree() { 883 883 $args = func_get_args(); 884 884 // 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 ) ) { 886 886 $walker = new Walker_Category; 887 else887 } else { 888 888 $walker = $args[2]['walker']; 889 889 } 890 890 return call_user_func_array(array( &$walker, 'walk' ), $args ); 891 891 } 892 892 -
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 44 set_transient($this->name, $data, $this->lifetime); 44 45 set_transient($this->mod_name, time(), $this->lifetime); -
src/wp-includes/class-wp-customize-manager.php
695 695 * constructor. 696 696 */ 697 697 public function add_setting( $id, $args = array() ) { 698 if ( is_a( $id, 'WP_Customize_Setting' ) )698 if ( $id instanceof WP_Customize_Setting ) { 699 699 $setting = $id; 700 else700 } else { 701 701 $setting = new WP_Customize_Setting( $this, $id, $args ); 702 702 } 703 703 $this->settings[ $setting->id ] = $setting; 704 704 } 705 705 … … 737 737 * @param array $args Optional. Panel arguments. Default empty array. 738 738 */ 739 739 public function add_panel( $id, $args = array() ) { 740 if ( is_a( $id, 'WP_Customize_Panel' )) {740 if ( $id instanceof WP_Customize_Panel ) { 741 741 $panel = $id; 742 } 743 else { 742 } else { 744 743 $panel = new WP_Customize_Panel( $this, $id, $args ); 745 744 } 746 745 … … 783 782 * @param array $args Section arguments. 784 783 */ 785 784 public function add_section( $id, $args = array() ) { 786 if ( is_a( $id, 'WP_Customize_Section' ) )785 if ( $id instanceof WP_Customize_Section ) { 787 786 $section = $id; 788 else787 } else { 789 788 $section = new WP_Customize_Section( $this, $id, $args ); 790 789 } 791 790 $this->sections[ $section->id ] = $section; 792 791 } 793 792 … … 825 824 * constructor. 826 825 */ 827 826 public function add_control( $id, $args = array() ) { 828 if ( is_a( $id, 'WP_Customize_Control' ) )827 if ( $id instanceof WP_Customize_Control ) { 829 828 $control = $id; 830 else829 } else { 831 830 $control = new WP_Customize_Control( $this, $id, $args ); 832 831 } 833 832 $this->controls[ $control->id ] = $control; 834 833 } 835 834 -
src/wp-includes/class-wp-error.php
214 214 * @param mixed $thing Check if unknown variable is a WP_Error object. 215 215 * @return bool True, if WP_Error. False, if not WP_Error. 216 216 */ 217 function is_wp_error($thing) { 218 if ( is_object($thing) && is_a($thing, 'WP_Error') ) 219 return true; 220 return false; 217 function is_wp_error( $thing ) { 218 return ( $thing instanceof WP_Error ); 221 219 } -
src/wp-includes/class-wp-theme.php
274 274 // Set the parent, if we're a child theme. 275 275 if ( $this->template != $this->stylesheet ) { 276 276 // 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 ) { 278 278 $_child->parent = null; 279 279 $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) ); 280 280 $_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
1117 1117 return $this->error; 1118 1118 1119 1119 // 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 ) ) { 1121 1121 $content_struct['post_date'] = $this->_convert_date( $content_struct['post_date'] ); 1122 1122 } 1123 1123 1124 1124 // ignore the existing GMT date if it is empty or a non-GMT date was supplied in $content_struct, 1125 1125 // 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 ) ) { 1127 1127 if ( $content_struct['post_date_gmt'] == '0000-00-00 00:00:00' || isset( $content_struct['post_date'] ) ) { 1128 1128 unset( $content_struct['post_date_gmt'] ); 1129 1129 } else { -
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
2684 2684 if ( is_object($user) ) { 2685 2685 if ( !isset($user->ID) ) 2686 2686 $user->ID = 0; 2687 if ( ! is_a( $user, 'WP_User') ) {2687 if ( ! ( $user instanceof WP_User ) ) { 2688 2688 $vars = get_object_vars($user); 2689 2689 foreach ( array_keys($vars) as $field ) { 2690 2690 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' ); … … 115 115 */ 116 116 function wp_localize_script( $handle, $object_name, $l10n ) { 117 117 global $wp_scripts; 118 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {118 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 119 119 if ( ! did_action( 'init' ) ) 120 120 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 121 121 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 141 141 */ 142 142 function wp_deregister_script( $handle ) { 143 143 global $wp_scripts; 144 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {144 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 145 145 if ( ! did_action( 'init' ) ) 146 146 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 147 147 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 197 197 */ 198 198 function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) { 199 199 global $wp_scripts; 200 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {200 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 201 201 if ( ! did_action( 'init' ) ) 202 202 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 203 203 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 229 229 */ 230 230 function wp_dequeue_script( $handle ) { 231 231 global $wp_scripts; 232 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {232 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 233 233 if ( ! did_action( 'init' ) ) 234 234 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 235 235 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 254 254 */ 255 255 function wp_script_is( $handle, $list = 'enqueued' ) { 256 256 global $wp_scripts; 257 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {257 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 258 258 if ( ! did_action( 'init' ) ) 259 259 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 260 260 '<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
2849 2849 */ 2850 2850 function wp_admin_css( $file = 'wp-admin', $force_echo = false ) { 2851 2851 global $wp_styles; 2852 if ( ! is_a($wp_styles, 'WP_Styles') )2852 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 2853 2853 $wp_styles = new WP_Styles(); 2854 } 2854 2855 2855 2856 // For backward compatibility 2856 2857 $handle = 0 === strpos( $file, 'css/' ) ? substr( $file, 4 ) : $file; -
src/wp-includes/ms-functions.php
2005 2005 * @return bool 2006 2006 */ 2007 2007 function is_user_spammy( $user = null ) { 2008 if ( ! is_a( $user, 'WP_User') ) {2009 if ( $user ) 2008 if ( ! ( $user instanceof WP_User ) ) { 2009 if ( $user ) { 2010 2010 $user = get_user_by( 'login', $user ); 2011 else2011 } else { 2012 2012 $user = wp_get_current_user(); 2013 } 2013 2014 } 2014 2015 2015 2016 return $user && isset( $user->spam ) && 1 == $user->spam; -
src/wp-includes/pluggable.php
260 260 global $phpmailer; 261 261 262 262 // (Re)create it, if it's gone missing 263 if ( ! is_object( $phpmailer ) || !is_a( $phpmailer, 'PHPMailer') ) {263 if ( ! ( $phpmailer instanceof PHPMailer ) ) { 264 264 require_once ABSPATH . WPINC . '/class-phpmailer.php'; 265 265 require_once ABSPATH . WPINC . '/class-smtp.php'; 266 266 $phpmailer = new PHPMailer( true ); -
src/wp-includes/post.php
422 422 if ( empty( $post ) && isset( $GLOBALS['post'] ) ) 423 423 $post = $GLOBALS['post']; 424 424 425 if ( is_a( $post, 'WP_Post' )) {425 if ( $post instanceof WP_Post ) { 426 426 $_post = $post; 427 427 } elseif ( is_object( $post ) ) { 428 428 if ( empty( $post->filter ) ) { -
src/wp-includes/script-loader.php
778 778 do_action( 'wp_print_scripts' ); 779 779 } 780 780 781 if ( ! is_a($wp_scripts, 'WP_Scripts') )781 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 782 782 $wp_scripts = new WP_Scripts(); 783 } 783 784 784 785 script_concat_settings(); 785 786 $wp_scripts->do_concat = $concatenate_scripts; … … 808 809 function print_footer_scripts() { 809 810 global $wp_scripts, $concatenate_scripts; 810 811 811 if ( ! is_a($wp_scripts, 'WP_Scripts') )812 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 812 813 return array(); // No need to run if not instantiated. 813 814 } 814 815 script_concat_settings(); 815 816 $wp_scripts->do_concat = $concatenate_scripts; 816 817 $wp_scripts->do_footer_items(); … … 892 893 893 894 global $wp_scripts; 894 895 895 if ( ! is_a($wp_scripts, 'WP_Scripts') )896 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 896 897 return array(); // no need to run if nothing is queued 897 898 } 898 899 return print_head_scripts(); 899 900 } 900 901 … … 947 948 function print_admin_styles() { 948 949 global $wp_styles, $concatenate_scripts; 949 950 950 if ( ! is_a($wp_styles, 'WP_Styles') )951 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 951 952 $wp_styles = new WP_Styles(); 953 } 952 954 953 955 script_concat_settings(); 954 956 $wp_styles->do_concat = $concatenate_scripts; … … 977 979 function print_late_styles() { 978 980 global $wp_styles, $concatenate_scripts; 979 981 980 if ( ! is_a($wp_styles, 'WP_Styles') )982 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 981 983 return; 984 } 982 985 983 986 $wp_styles->do_concat = $concatenate_scripts; 984 987 $wp_styles->do_footer_items(); -
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/theme.php
2027 2027 function is_customize_preview() { 2028 2028 global $wp_customize; 2029 2029 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(); 2031 2031 } -
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 instanceof WP_User && is_multisite() ) { 206 206 /** 207 207 * Filter whether the user has been marked as a spammer. 208 208 * … … 1710 1710 function wp_insert_user( $userdata ) { 1711 1711 global $wpdb; 1712 1712 1713 if ( is_a( $userdata, 'stdClass' )) {1713 if ( $userdata instanceof stdClass ) { 1714 1714 $userdata = get_object_vars( $userdata ); 1715 } elseif ( is_a( $userdata, 'WP_User' )) {1715 } elseif ( $userdata instanceof WP_User ) { 1716 1716 $userdata = $userdata->to_array(); 1717 1717 } 1718 1718 // Are we updating or creating? … … 1969 1969 * @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated. 1970 1970 */ 1971 1971 function wp_update_user($userdata) { 1972 if ( is_a( $userdata, 'stdClass' ) )1972 if ( $userdata instanceof stdClass ) { 1973 1973 $userdata = get_object_vars( $userdata ); 1974 elseif ( is_a( $userdata, 'WP_User' ) )1974 } elseif ( $userdata instanceof WP_User ) { 1975 1975 $userdata = $userdata->to_array(); 1976 } 1976 1977 1977 1978 $ID = (int) $userdata['ID']; 1978 1979 -
src/wp-includes/widgets.php
1552 1552 global $wp_widget_factory; 1553 1553 1554 1554 $widget_obj = $wp_widget_factory->widgets[$widget]; 1555 if ( ! is_a($widget_obj, 'WP_Widget') )1555 if ( ! ( $widget_obj instanceof WP_Widget ) ) { 1556 1556 return; 1557 } 1557 1558 1558 1559 $before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname'] ); 1559 1560 $default_args = array( 'before_widget' => $before_widget, 'after_widget' => "</div>", 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>' );