Ticket #21601: 21601_wp_user.patch
File 21601_wp_user.patch, 1.3 KB (added by , 13 years ago) |
---|
-
wp-includes/capabilities.php
585 585 586 586 return metadata_exists( 'user', $this->ID, $key ); 587 587 } 588 589 /** 590 * Magic method for checking whether a certain custom field has a value 591 * 592 * @since 3.5.0 593 */ 594 function __hasval( $key ) { 595 if ( 'id' == $key ) { 596 _deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) ); 597 $key = 'ID'; 598 } 588 599 600 if ( isset( $this->data->$key ) && ! empty( $this->data->$key ) ) 601 return true; 602 603 if ( isset( self::$back_compat_keys[ $key ] ) ) 604 $key = self::$back_compat_keys[ $key ]; 605 606 if ( $this->__isset( $key ) ) 607 $value = $this->__get( $key ); 608 609 if ( $value ) 610 return $value; 611 else 612 return false; 613 } 614 589 615 /** 590 616 * Magic method for accessing custom fields 591 617 * … … 664 690 function has_prop( $key ) { 665 691 return $this->__isset( $key ); 666 692 } 693 694 /** 695 * Determine whether a property or meta key has a value 696 * 697 * Consults the users and usermeta tables. 698 * 699 * @since 3.5.0 700 * 701 * @param string $key Property 702 */ 703 function has_prop_val( $key ) { 704 return $this->__hasval( $key ); 705 } 667 706 668 707 /* 669 708 * Return an array representation.