diff --git src/wp-includes/capabilities-functions.php src/wp-includes/capabilities-functions.php
index 4274fa5..e0c07a4 100644
|
|
function map_meta_cap( $cap, $user_id ) { |
52 | 52 | } |
53 | 53 | |
54 | 54 | $post_type = get_post_type_object( $post->post_type ); |
| 55 | if ( ! $post_type ) { |
| 56 | $cap = 'edit_others_posts'; |
| 57 | break; |
| 58 | } |
55 | 59 | |
56 | 60 | if ( ! $post_type->map_meta_cap ) { |
57 | 61 | $caps[] = $post_type->cap->$cap; |
… |
… |
function map_meta_cap( $cap, $user_id ) { |
100 | 104 | } |
101 | 105 | |
102 | 106 | $post_type = get_post_type_object( $post->post_type ); |
| 107 | if ( ! $post_type ) { |
| 108 | $cap = 'edit_others_posts'; |
| 109 | break; |
| 110 | } |
103 | 111 | |
104 | 112 | if ( ! $post_type->map_meta_cap ) { |
105 | 113 | $caps[] = $post_type->cap->$cap; |
… |
… |
function map_meta_cap( $cap, $user_id ) { |
142 | 150 | } |
143 | 151 | |
144 | 152 | $post_type = get_post_type_object( $post->post_type ); |
| 153 | if ( ! $post_type ) { |
| 154 | $cap = 'edit_others_posts'; |
| 155 | break; |
| 156 | } |
145 | 157 | |
146 | 158 | if ( ! $post_type->map_meta_cap ) { |
147 | 159 | $caps[] = $post_type->cap->$cap; |
… |
… |
function map_meta_cap( $cap, $user_id ) { |
168 | 180 | case 'publish_post': |
169 | 181 | $post = get_post( $args[0] ); |
170 | 182 | $post_type = get_post_type_object( $post->post_type ); |
| 183 | if ( ! $post_type ) { |
| 184 | $cap = 'edit_others_posts'; |
| 185 | break; |
| 186 | } |
171 | 187 | |
172 | 188 | $caps[] = $post_type->cap->publish_posts; |
173 | 189 | break; |