Changeset 31188
- Timestamp:
- 01/16/2015 01:05:52 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-users-list-table.php
r31181 r31188 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; -
trunk/src/wp-admin/includes/screen.php
r30979 r31188 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; -
trunk/src/wp-admin/includes/template.php
r31181 r31188 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 { -
trunk/src/wp-admin/includes/theme.php
r31090 r31188 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(); -
trunk/src/wp-includes/capabilities.php
r31147 r31188 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; -
trunk/src/wp-includes/category-template.php
r31027 r31188 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 } -
trunk/src/wp-includes/class-feed.php
r28505 r31188 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); -
trunk/src/wp-includes/class-wp-customize-manager.php
r31085 r31188 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 } … … 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 } … … 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 } … … 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 } -
trunk/src/wp-includes/class-wp-error.php
r31138 r31188 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 } -
trunk/src/wp-includes/class-wp-theme.php
r31108 r31188 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 ) ); -
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r31149 r31188 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 } … … 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'] ); -
trunk/src/wp-includes/compat.php
r30075 r31188 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(); … … 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(); -
trunk/src/wp-includes/deprecated.php
r31106 r31188 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 ) { -
trunk/src/wp-includes/functions.wp-scripts.php
r31030 r31188 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.' ), … … 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.' ), … … 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.' ), … … 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.' ), … … 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.' ), … … 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.' ), … … 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.' ), -
trunk/src/wp-includes/functions.wp-styles.php
r30674 r31188 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.' ), … … 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.' ), … … 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.' ), … … 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.' ), … … 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.' ), … … 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.' ), … … 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.' ), -
trunk/src/wp-includes/general-template.php
r31170 r31188 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 -
trunk/src/wp-includes/ms-functions.php
r31168 r31188 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 -
trunk/src/wp-includes/pluggable.php
r31152 r31188 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'; -
trunk/src/wp-includes/post.php
r31169 r31188 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 ) ) { -
trunk/src/wp-includes/script-loader.php
r31170 r31188 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(); … … 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; … … 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 } … … 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(); … … 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; -
trunk/src/wp-includes/template.php
r31090 r31188 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"; -
trunk/src/wp-includes/theme.php
r31168 r31188 2028 2028 global $wp_customize; 2029 2029 2030 return is_a( $wp_customize, 'WP_Customize_Manager') && $wp_customize->is_preview();2031 } 2030 return ( $wp_customize instanceof WP_Customize_Manager ) && $wp_customize->is_preview(); 2031 } -
trunk/src/wp-includes/user.php
r31144 r31188 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 } … … 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 } … … 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. … … 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 } … … 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']; -
trunk/src/wp-includes/widgets.php
r31077 r31188 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'] );
Note: See TracChangeset
for help on using the changeset viewer.