@@ 424-427 (lines=4) @@ | ||
421 | if ( empty($post_data) ) |
|
422 | $post_data = &$_POST; |
|
423 | ||
424 | if ( isset($post_data['post_type']) ) |
|
425 | $ptype = get_post_type_object($post_data['post_type']); |
|
426 | else |
|
427 | $ptype = get_post_type_object('post'); |
|
428 | ||
429 | if ( !current_user_can( $ptype->cap->edit_posts ) ) { |
|
430 | if ( 'page' == $ptype->name ) |
|
@@ 717-720 (lines=4) @@ | ||
714 | * @return int|WP_Error |
|
715 | */ |
|
716 | function wp_write_post() { |
|
717 | if ( isset($_POST['post_type']) ) |
|
718 | $ptype = get_post_type_object($_POST['post_type']); |
|
719 | else |
|
720 | $ptype = get_post_type_object('post'); |
|
721 | ||
722 | if ( !current_user_can( $ptype->cap->edit_posts ) ) { |
|
723 | if ( 'page' == $ptype->name ) |