Ticket #25672: 25672.diff
File 25672.diff, 24.4 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/template.php
147 147 148 148 extract( wp_parse_args($args, $defaults), EXTR_SKIP ); 149 149 150 if ( empty($walker) || ! is_a($walker, 'Walker') )150 if ( empty($walker) || ! ( $walker instanceof Walker ) ) 151 151 $walker = new Walker_Category_Checklist; 152 152 153 153 $descendants_and_self = (int) $descendants_and_self; -
wp-admin/includes/screen.php
389 389 */ 390 390 public static function get( $hook_name = '' ) { 391 391 392 if ( is_a( $hook_name, 'WP_Screen' ))392 if ( $hook_name instanceof WP_Screen ) 393 393 return $hook_name; 394 394 395 395 $post_type = $taxonomy = null; -
wp-admin/includes/class-wp-users-list-table.php
227 227 function single_row( $user_object, $style = '', $role = '', $numposts = 0 ) { 228 228 global $wp_roles; 229 229 230 if ( ! ( is_object( $user_object ) && is_a( $user_object, 'WP_User') ) )230 if ( ! ( is_object( $user_object ) && ( $user_object instanceof WP_User ) ) ) 231 231 $user_object = get_userdata( (int) $user_object ); 232 232 233 $user_object->filter = 'display'; 233 234 $email = $user_object->user_email; 234 235 -
wp-admin/includes/theme.php
117 117 if ( !isset($themes_update) ) 118 118 $themes_update = get_site_transient('update_themes'); 119 119 120 if ( ! is_a( $theme, 'WP_Theme') )120 if ( ! ( $theme instanceof WP_Theme ) ) 121 121 return; 122 122 123 123 $stylesheet = $theme->get_stylesheet(); -
wp-includes/general-template.php
2151 2151 */ 2152 2152 function wp_admin_css( $file = 'wp-admin', $force_echo = false ) { 2153 2153 global $wp_styles; 2154 if ( ! is_a($wp_styles, 'WP_Styles') )2154 if ( ! ( $wp_styles instanceof WP_Styles ) ) 2155 2155 $wp_styles = new WP_Styles(); 2156 2156 2157 2157 // For backward compatibility -
wp-includes/capabilities.php
486 486 ); 487 487 } 488 488 489 if ( is_a( $id, 'WP_User' )) {489 if ( $id instanceof WP_User ) { 490 490 $this->init( $id->data, $blog_id ); 491 491 return; 492 492 } elseif ( is_object( $id ) ) { -
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 -
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 } -
wp-includes/deprecated.php
2670 2670 if ( is_object($user) ) { 2671 2671 if ( !isset($user->ID) ) 2672 2672 $user->ID = 0; 2673 if ( ! is_a( $user, 'WP_User') ) {2673 if ( ! ( $user instanceof WP_User ) ) { 2674 2674 $vars = get_object_vars($user); 2675 2675 foreach ( array_keys($vars) as $field ) { 2676 2676 if ( is_string($user->$field) || is_numeric($user->$field) ) -
wp-includes/pluggable.php
221 221 global $phpmailer; 222 222 223 223 // (Re)create it, if it's gone missing 224 if ( !is_object( $phpmailer ) || ! is_a( $phpmailer, 'PHPMailer') ) {224 if ( !is_object( $phpmailer ) || ! ( $phpmailer instanceof PHPMailer ) ) { 225 225 require_once ABSPATH . WPINC . '/class-phpmailer.php'; 226 226 require_once ABSPATH . WPINC . '/class-smtp.php'; 227 227 $phpmailer = new PHPMailer( true ); -
wp-includes/widgets.php
1135 1135 global $wp_widget_factory; 1136 1136 1137 1137 $widget_obj = $wp_widget_factory->widgets[$widget]; 1138 if ( ! is_a($widget_obj, 'WP_Widget') )1138 if ( ! ( $widget_obj instanceof WP_Widget ) ) 1139 1139 return; 1140 1140 1141 1141 $before_widget = sprintf('<div class="widget %s">', $widget_obj->widget_options['classname'] ); -
wp-includes/script-loader.php
698 698 if ( ! did_action('wp_print_scripts') ) 699 699 do_action('wp_print_scripts'); 700 700 701 if ( ! is_a($wp_scripts, 'WP_Scripts') )701 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) 702 702 $wp_scripts = new WP_Scripts(); 703 703 704 704 script_concat_settings(); … … 720 720 function print_footer_scripts() { 721 721 global $wp_scripts, $concatenate_scripts; 722 722 723 if ( ! is_a($wp_scripts, 'WP_Scripts') )723 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) 724 724 return array(); // No need to run if not instantiated. 725 725 726 726 script_concat_settings(); … … 779 779 780 780 global $wp_scripts; 781 781 782 if ( ! is_a($wp_scripts, 'WP_Scripts') )782 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) 783 783 return array(); // no need to run if nothing is queued 784 784 785 785 return print_head_scripts(); … … 824 824 function print_admin_styles() { 825 825 global $wp_styles, $concatenate_scripts, $compress_css; 826 826 827 if ( ! is_a($wp_styles, 'WP_Styles') )827 if ( ! ( $wp_styles instanceof WP_Styles ) ) 828 828 $wp_styles = new WP_Styles(); 829 829 830 830 script_concat_settings(); … … 850 850 function print_late_styles() { 851 851 global $wp_styles, $concatenate_scripts; 852 852 853 if ( ! is_a($wp_styles, 'WP_Styles') )853 if ( ! ( $wp_styles instanceof WP_Styles ) ) 854 854 return; 855 855 856 856 $wp_styles->do_concat = $concatenate_scripts; -
wp-includes/class-wp-error.php
202 202 * @return bool True, if WP_Error. False, if not WP_Error. 203 203 */ 204 204 function is_wp_error($thing) { 205 if ( is_object($thing) && is_a($thing, 'WP_Error') )205 if ( is_object($thing) && ( $thing instanceof WP_Error ) ) 206 206 return true; 207 207 return false; 208 208 } -
wp-includes/ms-functions.php
1720 1720 * @return bool 1721 1721 */ 1722 1722 function is_user_spammy( $user = null ) { 1723 if ( ! is_a( $user, 'WP_User') ) {1723 if ( ! ( $user instanceof WP_User ) ) { 1724 1724 if ( $user ) 1725 1725 $user = get_user_by( 'login', $user ); 1726 1726 else -
wp-includes/category-template.php
728 728 function walk_category_tree() { 729 729 $args = func_get_args(); 730 730 // the user's options are the third parameter 731 if ( empty( $args[2]['walker']) || !is_a($args[2]['walker'], 'Walker'))731 if ( empty( $args[2]['walker'] ) || ! $args[2]['walker'] instanceof Walker ) 732 732 $walker = new Walker_Category; 733 733 else 734 734 $walker = $args[2]['walker']; … … 746 746 function walk_category_dropdown_tree() { 747 747 $args = func_get_args(); 748 748 // the user's options are the third parameter 749 if ( empty( $args[2]['walker']) || !is_a($args[2]['walker'], 'Walker'))749 if ( empty( $args[2]['walker'] ) || ! $args[2]['walker'] instanceof Walker ) 750 750 $walker = new Walker_CategoryDropdown; 751 751 else 752 752 $walker = $args[2]['walker']; -
wp-includes/class-feed.php
37 37 } 38 38 39 39 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); -
wp-includes/class-wp-customize-manager.php
527 527 * @param array $args Setting arguments. 528 528 */ 529 529 public function add_setting( $id, $args = array() ) { 530 if ( is_a( $id, 'WP_Customize_Setting' ))530 if ( $id instanceof WP_Customize_Setting ) 531 531 $setting = $id; 532 532 else 533 533 $setting = new WP_Customize_Setting( $this, $id, $args ); … … 568 568 * @param array $args Section arguments. 569 569 */ 570 570 public function add_section( $id, $args = array() ) { 571 if ( is_a( $id, 'WP_Customize_Section' ))571 if ( $id instanceof WP_Customize_Section ) 572 572 $section = $id; 573 573 else 574 574 $section = new WP_Customize_Section( $this, $id, $args ); … … 609 609 * @param array $args Setting arguments. 610 610 */ 611 611 public function add_control( $id, $args = array() ) { 612 if ( is_a( $id, 'WP_Customize_Control' ))612 if ( $id instanceof WP_Customize_Control ) 613 613 $control = $id; 614 614 else 615 615 $control = new WP_Customize_Control( $this, $id, $args ); -
wp-includes/functions.wp-scripts.php
30 30 $handles = false; 31 31 32 32 global $wp_scripts; 33 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {33 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 34 34 if ( ! did_action( 'init' ) ) 35 35 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 36 36 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 67 67 */ 68 68 function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) { 69 69 global $wp_scripts; 70 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {70 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 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' ); … … 107 107 */ 108 108 function wp_localize_script( $handle, $object_name, $l10n ) { 109 109 global $wp_scripts; 110 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {110 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 111 111 if ( ! did_action( 'init' ) ) 112 112 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 113 113 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 133 133 */ 134 134 function wp_deregister_script( $handle ) { 135 135 global $wp_scripts; 136 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {136 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 137 137 if ( ! did_action( 'init' ) ) 138 138 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 139 139 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 189 189 */ 190 190 function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false, $in_footer = false ) { 191 191 global $wp_scripts; 192 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {192 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 193 193 if ( ! did_action( 'init' ) ) 194 194 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 195 195 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 217 217 */ 218 218 function wp_dequeue_script( $handle ) { 219 219 global $wp_scripts; 220 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {220 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 221 221 if ( ! did_action( 'init' ) ) 222 222 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 223 223 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 242 242 */ 243 243 function wp_script_is( $handle, $list = 'enqueued' ) { 244 244 global $wp_scripts; 245 if ( ! is_a( $wp_scripts, 'WP_Scripts') ) {245 if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { 246 246 if ( ! did_action( 'init' ) ) 247 247 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 248 248 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); -
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 } -
wp-includes/post.php
389 389 if ( empty( $post ) && isset( $GLOBALS['post'] ) ) 390 390 $post = $GLOBALS['post']; 391 391 392 if ( is_a( $post, 'WP_Post' )) {392 if ( $post instanceof WP_Post ) { 393 393 $_post = $post; 394 394 } elseif ( is_object( $post ) ) { 395 395 if ( empty( $post->filter ) ) { -
wp-includes/class-wp-theme.php
263 263 // Set the parent, if we're a child theme. 264 264 if ( $this->template != $this->stylesheet ) { 265 265 // If we are a parent, then there is a problem. Only two generations allowed! Cancel things out. 266 if ( is_a( $_child, 'WP_Theme') && $_child->template == $this->stylesheet ) {266 if ( ( $_child instanceof WP_Theme ) && $_child->template == $this->stylesheet ) { 267 267 $_child->parent = null; 268 268 $_child->errors = new WP_Error( 'theme_parent_invalid', sprintf( __( 'The "%s" theme is not a valid parent theme.' ), $_child->template ) ); 269 269 $_child->cache_add( 'theme', array( 'headers' => $_child->headers, 'errors' => $_child->errors, 'stylesheet' => $_child->stylesheet, 'template' => $_child->template ) ); -
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 … … 391 391 $result = $this->call($this->message->methodName, $this->message->params); 392 392 393 393 // Is the result an error? 394 if ( is_a($result, 'IXR_Error')) {394 if ( $result instanceof IXR_Error ) { 395 395 $this->error($result); 396 396 } 397 397 … … 538 538 } else { 539 539 $result = $this->call($method, $params); 540 540 } 541 if ( is_a($result, 'IXR_Error')) {541 if ( $result instanceof IXR_Error ) { 542 542 $return[] = array( 543 543 'faultCode' => $result->code, 544 544 'faultString' => $result->message … … 976 976 break; 977 977 case 'date': 978 978 case 'dateTime.iso8601': 979 if ( !is_a($arg, 'IXR_Date')) {979 if ( ! ( $arg instanceof IXR_Date ) ) { 980 980 $ok = false; 981 981 } 982 982 break; -
wp-includes/user.php
70 70 */ 71 71 add_filter('authenticate', 'wp_authenticate_username_password', 20, 3); 72 72 function wp_authenticate_username_password($user, $username, $password) { 73 if ( is_a($user, 'WP_User') ) { return $user; } 73 if ( $user instanceof WP_User ) 74 return $user; 74 75 75 76 if ( empty($username) || empty($password) ) { 76 77 if ( is_wp_error( $user ) ) … … 107 108 * Authenticate the user using the WordPress auth cookie. 108 109 */ 109 110 function wp_authenticate_cookie($user, $username, $password) { 110 if ( is_a($user, 'WP_User') ) { return $user; } 111 if ( $user instanceof WP_User ) 112 return $user; 111 113 112 114 if ( empty($username) && empty($password) ) { 113 115 $user_id = wp_validate_auth_cookie(); … … 137 139 * @since 3.7.0 138 140 */ 139 141 function wp_authenticate_spam_check( $user ) { 140 if ( $user && is_a( $user, 'WP_User') && is_multisite() ) {142 if ( $user && ( $user instanceof WP_User ) && is_multisite() ) { 141 143 $spammed = apply_filters( 'check_is_user_spammed', is_user_spammy(), $user ); 142 144 143 145 if ( $spammed ) … … 1302 1304 function wp_insert_user( $userdata ) { 1303 1305 global $wpdb; 1304 1306 1305 if ( is_a( $userdata, 'stdClass' ))1307 if ( $userdata instanceof stdClass ) 1306 1308 $userdata = get_object_vars( $userdata ); 1307 elseif ( is_a( $userdata, 'WP_User' ))1309 elseif ( $userdata instanceof WP_User ) 1308 1310 $userdata = $userdata->to_array(); 1309 1311 1310 1312 extract( $userdata, EXTR_SKIP ); … … 1460 1462 * @return int|WP_Error The updated user's ID or a WP_Error object if the user could not be updated. 1461 1463 */ 1462 1464 function wp_update_user($userdata) { 1463 if ( is_a( $userdata, 'stdClass' ))1465 if ( $userdata instanceof stdClass ) 1464 1466 $userdata = get_object_vars( $userdata ); 1465 elseif ( is_a( $userdata, 'WP_User' ))1467 elseif ( $userdata instanceof WP_User ) 1466 1468 $userdata = $userdata->to_array(); 1467 1469 1468 1470 $ID = (int) $userdata['ID']; -
wp-includes/functions.wp-styles.php
31 31 do_action( 'wp_print_styles' ); 32 32 33 33 global $wp_styles; 34 if ( ! is_a( $wp_styles, 'WP_Styles') ) {34 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 35 35 if ( ! did_action( 'init' ) ) 36 36 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 37 37 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 64 64 */ 65 65 function wp_add_inline_style( $handle, $data ) { 66 66 global $wp_styles; 67 if ( ! is_a( $wp_styles, 'WP_Styles') ) {67 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 68 68 if ( ! did_action( 'init' ) ) 69 69 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 70 70 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 99 99 */ 100 100 function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media = 'all' ) { 101 101 global $wp_styles; 102 if ( ! is_a( $wp_styles, 'WP_Styles') ) {102 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 103 103 if ( ! did_action( 'init' ) ) 104 104 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 105 105 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 121 121 */ 122 122 function wp_deregister_style( $handle ) { 123 123 global $wp_styles; 124 if ( ! is_a( $wp_styles, 'WP_Styles') ) {124 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 125 125 if ( ! did_action( 'init' ) ) 126 126 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 127 127 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 154 154 */ 155 155 function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false, $media = 'all' ) { 156 156 global $wp_styles; 157 if ( ! is_a( $wp_styles, 'WP_Styles') ) {157 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 158 158 if ( ! did_action( 'init' ) ) 159 159 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 160 160 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 180 180 */ 181 181 function wp_dequeue_style( $handle ) { 182 182 global $wp_styles; 183 if ( ! is_a( $wp_styles, 'WP_Styles') ) {183 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 184 184 if ( ! did_action( 'init' ) ) 185 185 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 186 186 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' ); … … 204 204 */ 205 205 function wp_style_is( $handle, $list = 'enqueued' ) { 206 206 global $wp_styles; 207 if ( ! is_a( $wp_styles, 'WP_Styles') ) {207 if ( ! ( $wp_styles instanceof WP_Styles ) ) { 208 208 if ( ! did_action( 'init' ) ) 209 209 _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ), 210 210 '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );