Ticket #16956: 16956.9.diff
File 16956.9.diff, 2.0 KB (added by , 9 years ago) |
---|
-
src/wp-includes/capabilities-functions.php
53 53 } 54 54 55 55 $post_type = get_post_type_object( $post->post_type ); 56 if ( ! $post_type ) { 57 /* translators: 1: capability name 2: post type */ 58 _doing_it_wrong( 'map_meta_cap', sprintf ( __( '%1$s capability checked againgst a non registerd post-type %2$s' ), $cap, $post->post_type), '4.4' ); 59 $cap = 'edit_others_posts'; 60 break; 61 } 56 62 57 63 if ( ! $post_type->map_meta_cap ) { 58 64 $caps[] = $post_type->cap->$cap; … … 101 107 } 102 108 103 109 $post_type = get_post_type_object( $post->post_type ); 110 if ( ! $post_type ) { 111 /* translators: 1: capability name 2: post type */ 112 _doing_it_wrong( 'map_meta_cap', sprintf ( __( '%1$s capability checked againgst a non registerd post-type %2$s' ), $cap, $post->post_type), '4.4' ); 113 $cap = 'edit_others_posts'; 114 break; 115 } 104 116 105 117 if ( ! $post_type->map_meta_cap ) { 106 118 $caps[] = $post_type->cap->$cap; … … 143 155 } 144 156 145 157 $post_type = get_post_type_object( $post->post_type ); 158 if ( ! $post_type ) { 159 /* translators: 1: capability name 2: post type */ 160 _doing_it_wrong( 'map_meta_cap', sprintf ( __( '%1$s capability checked againgst a non registerd post-type %2$s' ), $cap, $post->post_type), '4.4' ); 161 $cap = 'edit_others_posts'; 162 break; 163 } 146 164 147 165 if ( ! $post_type->map_meta_cap ) { 148 166 $caps[] = $post_type->cap->$cap; … … 169 187 case 'publish_post': 170 188 $post = get_post( $args[0] ); 171 189 $post_type = get_post_type_object( $post->post_type ); 190 if ( ! $post_type ) { 191 /* translators: 1: capability name 2: post type */ 192 _doing_it_wrong( 'map_meta_cap', sprintf ( __( '%1$s capability checked againgst a non registerd post-type %2$s' ), $cap, $post->post_type), '4.4' ); 193 $cap = 'edit_others_posts'; 194 break; 195 } 172 196 173 197 $caps[] = $post_type->cap->publish_posts; 174 198 break;