Changeset 12023 for trunk/wp-includes/capabilities.php
- Timestamp:
- 10/13/2009 05:04:22 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r11929 r12023 961 961 962 962 /** 963 * Whether author of supplied post has capability or role. 964 * 965 * @since 2.9 966 * 967 * @param int|object $post Post ID or post object. 968 * @param string $capability Capability or role name. 969 * @return bool 970 */ 971 function author_can( $post, $capability ) { 972 if ( !$post = get_post($post) ) 973 return false; 974 975 $author = new WP_User( $post->post_author ); 976 977 if ( empty( $author ) ) 978 return false; 979 980 $args = array_slice( func_get_args(), 2 ); 981 $args = array_merge( array( $capability ), $args ); 982 983 return call_user_func_array( array( &$author, 'has_cap' ), $args ); 984 } 985 986 /** 963 987 * Retrieve role object. 964 988 *
Note: See TracChangeset
for help on using the changeset viewer.