Changeset 28531
- Timestamp:
- 05/19/2014 05:19:09 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/list-table.php
r28500 r28531 88 88 public $_columns; 89 89 90 public function _ WP_List_Table_Compat( $screen, $columns = array() ) {90 public function __construct( $screen, $columns = array() ) { 91 91 if ( is_string( $screen ) ) 92 92 $screen = convert_to_screen( $screen ); -
trunk/src/wp-includes/capabilities.php
r28503 r28531 305 305 * @var string 306 306 */ 307 var$name;307 public $name; 308 308 309 309 /** … … 314 314 * @var array 315 315 */ 316 var$capabilities;316 public $capabilities; 317 317 318 318 /** … … 328 328 * @param array $capabilities List of capabilities. 329 329 */ 330 function __construct( $role, $capabilities ) {330 public function __construct( $role, $capabilities ) { 331 331 $this->name = $role; 332 332 $this->capabilities = $capabilities; … … 343 343 * @param bool $grant Whether role has capability privilege. 344 344 */ 345 function add_cap( $cap, $grant = true ) {345 public function add_cap( $cap, $grant = true ) { 346 346 global $wp_roles; 347 347 … … 366 366 * @param string $cap Capability name. 367 367 */ 368 function remove_cap( $cap ) {368 public function remove_cap( $cap ) { 369 369 global $wp_roles; 370 370 … … 390 390 * @return bool True, if user has capability. False, if doesn't have capability. 391 391 */ 392 function has_cap( $cap ) {392 public function has_cap( $cap ) { 393 393 /** 394 394 * Filter which capabilities a role has. … … 433 433 * @var int 434 434 */ 435 var$ID = 0;435 public $ID = 0; 436 436 437 437 /** … … 442 442 * @var array 443 443 */ 444 var$caps = array();444 public $caps = array(); 445 445 446 446 /** … … 451 451 * @var string 452 452 */ 453 var$cap_key;453 public $cap_key; 454 454 455 455 /** … … 460 460 * @var array 461 461 */ 462 var$roles = array();462 public $roles = array(); 463 463 464 464 /** … … 469 469 * @var array 470 470 */ 471 var$allcaps = array();471 public $allcaps = array(); 472 472 473 473 /** … … 495 495 * @return WP_User 496 496 */ 497 function __construct( $id = 0, $name = '', $blog_id = '' ) {497 public function __construct( $id = 0, $name = '', $blog_id = '' ) { 498 498 if ( ! isset( self::$back_compat_keys ) ) { 499 499 $prefix = $GLOBALS['wpdb']->prefix; … … 536 536 * @param int $blog_id Optional. The blog id to initialize for 537 537 */ 538 function init( $data, $blog_id = '' ) {538 public function init( $data, $blog_id = '' ) { 539 539 $this->data = $data; 540 540 $this->ID = (int) $data->ID; … … 552 552 * @return object Raw user object 553 553 */ 554 static function get_data_by( $field, $value ) {554 public static function get_data_by( $field, $value ) { 555 555 global $wpdb; 556 556 … … 612 612 * @since 3.3.0 613 613 */ 614 function __isset( $key ) {614 public function __isset( $key ) { 615 615 if ( 'id' == $key ) { 616 616 _deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) ); … … 632 632 * @since 3.3.0 633 633 */ 634 function __get( $key ) {634 public function __get( $key ) { 635 635 if ( 'id' == $key ) { 636 636 _deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) ); … … 658 658 * @since 3.3.0 659 659 */ 660 function __set( $key, $value ) {660 public function __set( $key, $value ) { 661 661 if ( 'id' == $key ) { 662 662 _deprecated_argument( 'WP_User->id', '2.1', __( 'Use <code>WP_User->ID</code> instead.' ) ); … … 676 676 * @return bool True if user exists in the database, false if not. 677 677 */ 678 function exists() {678 public function exists() { 679 679 return ! empty( $this->ID ); 680 680 } … … 689 689 * @param string $key Property 690 690 */ 691 function get( $key ) {691 public function get( $key ) { 692 692 return $this->__get( $key ); 693 693 } … … 702 702 * @param string $key Property 703 703 */ 704 function has_prop( $key ) {704 public function has_prop( $key ) { 705 705 return $this->__isset( $key ); 706 706 } … … 713 713 * @return array Array representation. 714 714 */ 715 function to_array() {715 public function to_array() { 716 716 return get_object_vars( $this->data ); 717 717 } … … 760 760 * @return array List of all capabilities for the user. 761 761 */ 762 function get_role_caps() {762 public function get_role_caps() { 763 763 global $wp_roles; 764 764 … … 791 791 * @param string $role Role name. 792 792 */ 793 function add_role( $role ) {793 public function add_role( $role ) { 794 794 $this->caps[$role] = true; 795 795 update_user_meta( $this->ID, $this->cap_key, $this->caps ); … … 806 806 * @param string $role Role name. 807 807 */ 808 function remove_role( $role ) {808 public function remove_role( $role ) { 809 809 if ( !in_array($role, $this->roles) ) 810 810 return; … … 827 827 * @param string $role Role name. 828 828 */ 829 function set_role( $role ) {829 public function set_role( $role ) { 830 830 if ( 1 == count( $this->roles ) && $role == current( $this->roles ) ) 831 831 return; … … 877 877 * @return int Max Level. 878 878 */ 879 function level_reduction( $max, $item ) {879 public function level_reduction( $max, $item ) { 880 880 if ( preg_match( '/^level_(10|[0-9])$/i', $item, $matches ) ) { 881 881 $level = intval( $matches[1] ); … … 896 896 * @access public 897 897 */ 898 function update_user_level_from_caps() {898 public function update_user_level_from_caps() { 899 899 global $wpdb; 900 900 $this->user_level = array_reduce( array_keys( $this->allcaps ), array( $this, 'level_reduction' ), 0 ); … … 911 911 * @param bool $grant Whether to grant capability to user. 912 912 */ 913 function add_cap( $cap, $grant = true ) {913 public function add_cap( $cap, $grant = true ) { 914 914 $this->caps[$cap] = $grant; 915 915 update_user_meta( $this->ID, $this->cap_key, $this->caps ); … … 924 924 * @param string $cap Capability name. 925 925 */ 926 function remove_cap( $cap ) {926 public function remove_cap( $cap ) { 927 927 if ( ! isset( $this->caps[$cap] ) ) 928 928 return; … … 937 937 * @access public 938 938 */ 939 function remove_all_caps() {939 public function remove_all_caps() { 940 940 global $wpdb; 941 941 $this->caps = array(); … … 958 958 * @return bool True, if user has capability; false, if user does not have capability. 959 959 */ 960 function has_cap( $cap ) {960 public function has_cap( $cap ) { 961 961 if ( is_numeric( $cap ) ) { 962 962 _deprecated_argument( __FUNCTION__, '2.0', __('Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.') ); … … 1008 1008 * @return string 1009 1009 */ 1010 function translate_level_to_cap( $level ) {1010 public function translate_level_to_cap( $level ) { 1011 1011 return 'level_' . $level; 1012 1012 } … … 1019 1019 * @param int $blog_id Optional Blog ID, defaults to current blog. 1020 1020 */ 1021 function for_blog( $blog_id = '' ) {1021 public function for_blog( $blog_id = '' ) { 1022 1022 global $wpdb; 1023 1023 if ( ! empty( $blog_id ) )
Note: See TracChangeset
for help on using the changeset viewer.