diff --git src/wp-includes/capabilities.php src/wp-includes/capabilities.php
index 588432d..398c7d5 100644
|
|
function map_meta_cap( $cap, $user_id ) { |
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | $post_type = get_post_type_object( $post->post_type ); |
| 1108 | if ( ! $post_type ) { |
| 1109 | $post_type = get_post_type_object( 'post' ); |
| 1110 | } |
1108 | 1111 | |
1109 | 1112 | if ( ! $post_type->map_meta_cap ) { |
1110 | 1113 | $caps[] = $post_type->cap->$cap; |
… |
… |
function map_meta_cap( $cap, $user_id ) { |
1151 | 1154 | } |
1152 | 1155 | |
1153 | 1156 | $post_type = get_post_type_object( $post->post_type ); |
| 1157 | if ( ! $post_type ) { |
| 1158 | $post_type = get_post_type_object( 'post' ); |
| 1159 | } |
1154 | 1160 | |
1155 | 1161 | if ( ! $post_type->map_meta_cap ) { |
1156 | 1162 | $caps[] = $post_type->cap->$cap; |
… |
… |
function map_meta_cap( $cap, $user_id ) { |
1193 | 1199 | } |
1194 | 1200 | |
1195 | 1201 | $post_type = get_post_type_object( $post->post_type ); |
| 1202 | if ( ! $post_type ) { |
| 1203 | $post_type = get_post_type_object( 'post' ); |
| 1204 | } |
1196 | 1205 | |
1197 | 1206 | if ( ! $post_type->map_meta_cap ) { |
1198 | 1207 | $caps[] = $post_type->cap->$cap; |
… |
… |
function map_meta_cap( $cap, $user_id ) { |
1219 | 1228 | case 'publish_post': |
1220 | 1229 | $post = get_post( $args[0] ); |
1221 | 1230 | $post_type = get_post_type_object( $post->post_type ); |
| 1231 | if ( ! $post_type ) { |
| 1232 | $post_type = get_post_type_object( 'post' ); |
| 1233 | } |
1222 | 1234 | |
1223 | 1235 | $caps[] = $post_type->cap->publish_posts; |
1224 | 1236 | break; |