Changeset 16273
- Timestamp:
- 11/10/2010 02:50:14 PM (10 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r16264 r16273 827 827 $post_type = get_post_type_object( $post->post_type ); 828 828 829 if ( 'delete_post' == $cap && $post_type && 'post' != $post_type->capability_type &&! $post_type->map_meta_cap ) {830 $ args = array_merge( array( $post_type->cap->delete_post, $user_id ), $args );831 return call_user_func_array( 'map_meta_cap', $args );829 if ( ! $post_type->map_meta_cap ) { 830 $caps[] = $post_type->cap->$cap; 831 break; 832 832 } 833 833 … … 870 870 $post_type = get_post_type_object( $post->post_type ); 871 871 872 if ( 'edit_post' == $cap && $post_type && 'post' != $post_type->capability_type &&! $post_type->map_meta_cap ) {873 $ args = array_merge( array( $post_type->cap->edit_post, $user_id ), $args );874 return call_user_func_array( 'map_meta_cap', $args );872 if ( ! $post_type->map_meta_cap ) { 873 $caps[] = $post_type->cap->$cap; 874 break; 875 875 } 876 876 … … 912 912 $post_type = get_post_type_object( $post->post_type ); 913 913 914 if ( 'read_post' == $cap && $post_type && 'post' != $post_type->capability_type &&! $post_type->map_meta_cap ) {915 $ args = array_merge( array( $post_type->cap->read_post, $user_id ), $args );916 return call_user_func_array( 'map_meta_cap', $args );914 if ( ! $post_type->map_meta_cap ) { 915 $caps[] = $post_type->cap->$cap; 916 break; 917 917 } 918 918 -
trunk/wp-includes/post.php
r16268 r16273 843 843 * - menu_position - The position in the menu order the post type should appear. Defaults to the bottom. 844 844 * - menu_icon - The url to the icon to be used for this menu. Defaults to use the posts icon. 845 * - capability_type - The post type to use for checkingread, edit, and delete capabilities. Defaults to 'post'.845 * - capability_type - The string to use to build the read, edit, and delete capabilities. Defaults to 'post'. 846 846 * May be passed as an array to allow for alternative plurals when using this argument as a base to construct the 847 847 * capabilities, e.g. array('story', 'stories'). … … 917 917 if ( null === $args->exclude_from_search ) 918 918 $args->exclude_from_search = !$args->public; 919 920 if ( empty($args->capability_type) )921 $args->capability_type = 'post';922 919 923 920 $args->cap = get_post_type_capabilities( $args );
Note: See TracChangeset
for help on using the changeset viewer.