WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/07/2010 11:35:28 PM (10 years ago)
Author:
scribu
Message:

Introduce 'edit_comment' meta cap. Fixes #14520

File:
1 edited

Legend:

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

    r15566 r15596  
    897897        //echo "post ID: {$args[0]}<br />";
    898898        $post = get_post( $args[0] );
     899
    899900        $post_type = get_post_type_object( $post->post_type );
    900901        if ( $post_type && 'post' != $post_type->capability_type ) {
     
    989990            $caps[] = 'read_private_pages';
    990991        break;
     992    case 'edit_comment':
     993        $comment = get_comment( $args[0] );
     994        $post = get_post( $comment->comment_post_ID );
     995        $post_type_object = get_post_type_object( $post->post_type );
     996
     997        $caps = map_meta_cap( $post_type_object->cap->edit_post, $user_id, $post->ID );
     998        break;
    991999    case 'unfiltered_upload':
    9921000        if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin( $user_id ) )  )
Note: See TracChangeset for help on using the changeset viewer.