WordPress.org

Make WordPress Core

Changeset 18200


Ignore:
Timestamp:
06/08/2011 06:06:43 PM (9 years ago)
Author:
markjaquith
Message:

Check parent caps for revisions. props aaroncampbell. fixes #17668

File:
1 edited

Legend:

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

    r17771 r18200  
    821821        $author_data = get_userdata( $user_id );
    822822        $post = get_post( $args[0] );
     823
     824        if ( 'revision' == $post->post_type ) {
     825            $post = get_post( $post->post_parent );
     826        }
     827
    823828        $post_type = get_post_type_object( $post->post_type );
    824829
     
    866871        $author_data = get_userdata( $user_id );
    867872        $post = get_post( $args[0] );
     873
     874        if ( 'revision' == $post->post_type ) {
     875            $post = get_post( $post->post_parent );
     876        }
     877
    868878        $post_type = get_post_type_object( $post->post_type );
    869879
     
    910920        $author_data = get_userdata( $user_id );
    911921        $post = get_post( $args[0] );
     922
     923        if ( 'revision' == $post->post_type ) {
     924            $post = get_post( $post->post_parent );
     925        }
     926
    912927        $post_type = get_post_type_object( $post->post_type );
    913928
Note: See TracChangeset for help on using the changeset viewer.