Changeset 34091 for trunk/src/wp-includes/capabilities-functions.php
- Timestamp:
- 09/12/2015 09:26:57 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/capabilities-functions.php
r33988 r34091 54 54 55 55 $post_type = get_post_type_object( $post->post_type ); 56 if ( ! $post_type ) { 57 /* translators: 1: post type, 2: capability name */ 58 _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' ); 59 $caps[] = 'edit_others_posts'; 60 break; 61 } 56 62 57 63 if ( ! $post_type->map_meta_cap ) { … … 102 108 103 109 $post_type = get_post_type_object( $post->post_type ); 110 if ( ! $post_type ) { 111 /* translators: 1: post type, 2: capability name */ 112 _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' ); 113 $caps[] = 'edit_others_posts'; 114 break; 115 } 104 116 105 117 if ( ! $post_type->map_meta_cap ) { … … 144 156 145 157 $post_type = get_post_type_object( $post->post_type ); 158 if ( ! $post_type ) { 159 /* translators: 1: post type, 2: capability name */ 160 _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' ); 161 $caps[] = 'edit_others_posts'; 162 break; 163 } 146 164 147 165 if ( ! $post_type->map_meta_cap ) { … … 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: post type, 2: capability name */ 192 _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' ); 193 $caps[] = 'edit_others_posts'; 194 break; 195 } 172 196 173 197 $caps[] = $post_type->cap->publish_posts;
Note: See TracChangeset
for help on using the changeset viewer.