Changeset 15892
- Timestamp:
- 10/21/2010 03:05:10 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r15890 r15892 990 990 */ 991 991 function get_post_type_capabilities( $args ) { 992 global $_post_type_meta_capabilities;993 994 992 $default_capabilities = array( 995 993 // Meta capabilities are generally mapped to primitive capabilities depending on the context … … 1004 1002 'read_private_posts' => 'read_private_' . $args->capability_type . 's', 1005 1003 ); 1004 1006 1005 // Primitive capabilities that are used within map_meta_cap(): 1007 1006 if ( $args->map_meta_cap ) { … … 1010 1009 'delete_posts' => 'delete_' . $args->capability_type . 's', 1011 1010 'delete_private_posts' => 'delete_private_' . $args->capability_type . 's', 1012 'delete_published_posts' => 'delete_published_' . $args->capability_type . 's', 1011 'delete_published_posts' => 'delete_published_' . $args->capability_type . 's', 1013 1012 'delete_others_posts' => 'delete_others_' . $args->capability_type . 's', 1014 1013 'edit_private_posts' => 'edit_private_' . $args->capability_type . 's', … … 1017 1016 $default_capabilities = array_merge( $default_capabilities, $default_capabilities_for_mapping ); 1018 1017 } 1018 1019 if ( ! post_type_supports( $args->name, 'author' ) ) { 1020 // While these may be checked in core, users/roles shouldn't need to be granted these. 1021 $default_capabilities['edit_others_posts'] = $default_capabilities['edit_posts']; 1022 $default_capabilities['delete_others_posts'] = $default_capabilities['delete_posts']; 1023 } 1024 1019 1025 $capabilities = array_merge( $default_capabilities, $args->capabilities ); 1026 1027 // Remember meta capabilities for future reference. 1020 1028 if ( $args->map_meta_cap ) 1021 1029 _post_type_meta_capabilities( $capabilities ); 1030 1022 1031 return (object) $capabilities; 1023 1032 }
Note: See TracChangeset
for help on using the changeset viewer.