| @@ 211-216 (lines=6) @@ | ||
| 208 | } |
|
| 209 | ||
| 210 | $ptype = get_post_type_object($post_data['post_type']); |
|
| 211 | if ( !current_user_can( 'edit_post', $post_ID ) ) { |
|
| 212 | if ( 'page' == $post_data['post_type'] ) |
|
| 213 | wp_die( __('Sorry, you are not allowed to edit this page.' )); |
|
| 214 | else |
|
| 215 | wp_die( __('Sorry, you are not allowed to edit this post.' )); |
|
| 216 | } |
|
| 217 | ||
| 218 | if ( post_type_supports( $ptype->name, 'revisions' ) ) { |
|
| 219 | $revisions = wp_get_post_revisions( $post_ID, array( 'order' => 'ASC', 'posts_per_page' => 1 ) ); |
|
| @@ 1622-1628 (lines=7) @@ | ||
| 1619 | if ( ! isset($_POST['post_ID']) || ! ( $post_ID = (int) $_POST['post_ID'] ) ) |
|
| 1620 | wp_die(); |
|
| 1621 | ||
| 1622 | if ( 'page' == $_POST['post_type'] ) { |
|
| 1623 | if ( ! current_user_can( 'edit_page', $post_ID ) ) |
|
| 1624 | wp_die( __( 'Sorry, you are not allowed to edit this page.' ) ); |
|
| 1625 | } else { |
|
| 1626 | if ( ! current_user_can( 'edit_post', $post_ID ) ) |
|
| 1627 | wp_die( __( 'Sorry, you are not allowed to edit this post.' ) ); |
|
| 1628 | } |
|
| 1629 | ||
| 1630 | if ( $last = wp_check_post_lock( $post_ID ) ) { |
|
| 1631 | $last_user = get_userdata( $last ); |
|