WordPress.org

Make WordPress Core

Changeset 16422


Ignore:
Timestamp:
11/17/2010 06:21:34 AM (9 years ago)
Author:
nacin
Message:

Don't check post_type_supports in map_meta_cap. see #14122.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r16273 r16422  
    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 {
    837             // No author set yet or post type doesn't support authors,
    838             // so default to current user for cap checks.
     837            // No author set yet, so default to current user for cap checks.
    839838            $post_author_data = $author_data;
    840839        }
     
    875874        }
    876875
    877         if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) {
     876        if ( '' != $post->post_author ) {
    878877            $post_author_data = get_userdata( $post->post_author );
    879878        } else {
    880             // No author set yet or post type doesn't support authors,
    881             // so default to current user for cap checks.
     879            // No author set yet, so default to current user for cap checks.
    882880            $post_author_data = $author_data;
    883881        }
     
    922920        }
    923921
    924         if ( '' != $post->post_author && post_type_supports( $post_type->name, 'author' ) ) {
     922        if ( '' != $post->post_author ) {
    925923            $post_author_data = get_userdata( $post->post_author );
    926924        } else {
    927             // No author set yet or post type doesn't support authors,
    928             // so default to current user for cap checks.
     925            // No author set yet, so default to current user for cap checks.
    929926            $post_author_data = $author_data;
    930927        }
  • trunk/wp-includes/post.php

    r16400 r16422  
    10871087
    10881088    if ( ! post_type_supports( $args->name, 'author' ) ) {
    1089         // While these may be checked in core, users/roles shouldn't need to be granted these.
     1089        // While these may be checked in core, users/roles shouldn't need to be
     1090        // granted these by default if the post type doesn't support authors.
    10901091        $default_capabilities['edit_others_posts']   = $default_capabilities['edit_posts'];
    10911092        if ( $args->map_meta_cap )
Note: See TracChangeset for help on using the changeset viewer.