Ticket #14122: 14122.remove.post_type_supports.author.diff

File 14122.remove.post_type_supports.author.diff, 1.9 KB (added by nacin, 19 months ago)

Removes the checks on post_type_supports('author'). Leaving this in would be a change from 3.0, but if most people are using 'supports' for meta boxes but still storing values in post_author, then I'm unsure of the side effects here.

  • wp-includes/post.php

     
    10721072                $default_capabilities = array_merge( $default_capabilities, $default_capabilities_for_mapping ); 
    10731073        } 
    10741074 
    1075         if ( ! post_type_supports( $args->name, 'author' ) ) { 
    1076                 // While these may be checked in core, users/roles shouldn't need to be granted these. 
    1077                 $default_capabilities['edit_others_posts']   = $default_capabilities['edit_posts']; 
    1078                 if ( $args->map_meta_cap ) 
    1079                         $default_capabilities['delete_others_posts'] = $default_capabilities['delete_posts']; 
    1080         } 
    1081  
    10821075        $capabilities = array_merge( $default_capabilities, $args->capabilities ); 
    10831076 
    10841077        // Remember meta capabilities for future reference. 
  • wp-includes/capabilities.php

     
    831831                        break; 
    832832                } 
    833833 
    834                 if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) { 
     834                if ( '' != $post->post_author ) { 
    835835                        $post_author_data = get_userdata( $post->post_author ); 
    836836                } else { 
    837837                        // No author set yet or post type doesn't support authors, 
     
    874874                        break; 
    875875                } 
    876876 
    877                 if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) { 
     877                if ( '' != $post->post_author ) { 
    878878                        $post_author_data = get_userdata( $post->post_author ); 
    879879                } else { 
    880880                        // No author set yet or post type doesn't support authors, 
     
    921921                        break; 
    922922                } 
    923923 
    924                 if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) { 
     924                if ( '' != $post->post_author ) { 
    925925                        $post_author_data = get_userdata( $post->post_author ); 
    926926                } else { 
    927927                        // No author set yet or post type doesn't support authors,