Changeset 16209
- Timestamp:
- 11/05/2010 05:04:46 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r15919 r16209 1081 1081 1082 1082 /** 1083 * Whether a particular user has capability or role. 1084 * 1085 * @since 3.1.0 1086 * 1087 * @param int|object $user User ID or object. 1088 * @param string $capability Capability or role name. 1089 * @return bool 1090 */ 1091 function user_can( $user, $capability ) { 1092 if ( ! is_object( $user ) ) 1093 $user = new WP_User( $user ); 1094 1095 if ( ! $user || ! $user->ID ) 1096 return false; 1097 1098 $args = array_slice( func_get_args(), 2 ); 1099 $args = array_merge( array( $capability ), $args ); 1100 1101 return call_user_func_array( array( &$user, 'has_cap' ), $args ); 1102 } 1103 1104 /** 1083 1105 * Retrieve role object. 1084 1106 *
Note: See TracChangeset
for help on using the changeset viewer.