Ticket #12590: 12590.diff
File 12590.diff, 3.2 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
25 25 'hierarchical' => false, 26 26 'rewrite' => false, 27 27 'query_var' => false, 28 'supports' => array(' post-thumbnails', 'excerpts', 'trackbacks', 'custom-fields', 'comments', 'revisions')28 'supports' => array('title', 'editor', 'post-thumbnails', 'excerpts', 'trackbacks', 'custom-fields', 'comments', 'revisions') 29 29 ) ); 30 30 31 31 register_post_type( 'page', array( 'label' => __('Pages'), … … 38 38 'hierarchical' => true, 39 39 'rewrite' => false, 40 40 'query_var' => false, 41 'supports' => array(' post-thumbnails', 'page-attributes', 'custom-fields', 'comments', 'revisions')41 'supports' => array('title', 'editor', 'post-thumbnails', 'page-attributes', 'custom-fields', 'comments', 'revisions') 42 42 ) ); 43 43 44 44 register_post_type( 'attachment', array('label' => __('Media'), -
wp-admin/includes/post.php
482 482 function wp_write_post() { 483 483 global $user_ID; 484 484 485 if ( isset( $_POST['post_type'] ) && 'page' == $_POST['post_type'] ) { 486 if ( !current_user_can( 'edit_pages' ) ) 487 return new WP_Error( 'edit_pages', __( 'You are not allowed to create pages on this blog.' ) ); 485 if ( isset( $_POST['post_type'] ) ) { 486 $post_type_obj = get_post_type_object($_POST['post_type']); 487 if ( !current_user_can($post_type_obj->edit_type_cap) ) 488 return new WP_Error( $post_type_obj->edit_type_cap, sprintf(__( 'You are not allowed to create %s on this blog.'), $post_type_obj->label) ); 488 489 } else { 489 490 if ( !current_user_can( 'edit_posts' ) ) 490 491 return new WP_Error( 'edit_posts', __( 'You are not allowed to create posts or drafts on this blog.' ) ); -
wp-admin/edit-form-advanced.php
184 184 185 185 <div id="post-body"> 186 186 <div id="post-body-content"> 187 <?php if ( post_type_supports($post_type, 'title') ) { ?> 187 188 <div id="titlediv"> 188 189 <div id="titlewrap"> 189 190 <label class="screen-reader-text" for="title"><?php _e('Title') ?></label> … … 198 199 199 200 if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->publish_cap ) ) ) { ?> 200 201 <div id="edit-slug-box"> 201 <?php202 if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status ) :203 echo $sample_permalink_html;204 endif;?>202 <?php 203 if ( ! empty($post->ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status ) 204 echo $sample_permalink_html; 205 ?> 205 206 </div> 206 207 <?php 207 } ?> 208 } 209 ?> 208 210 </div> 209 211 </div> 212 <?php } ?> 210 213 214 <?php if ( post_type_supports($post_type, 'editor') ) { ?> 211 215 <div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea"> 212 216 213 217 <?php the_editor($post->post_content); ?> … … 239 243 </div> 240 244 241 245 <?php 246 } 242 247 243 248 do_meta_boxes($post_type, 'normal', $post); 244 249