Ticket #20991: 20991.patch
File 20991.patch, 1.1 KB (added by , 12 years ago) |
---|
-
wp-includes/class-wp-xmlrpc-server.php
1390 1390 1391 1391 $query = array(); 1392 1392 1393 $post_type = get_post_type_object( 'post' ); 1393 1394 if ( isset( $filter['post_type'] ) ) { 1394 1395 $post_type = get_post_type_object( $filter['post_type'] ); 1395 1396 if ( ! ( (bool) $post_type ) ) 1396 1397 return new IXR_Error( 403, __( 'The post type specified is not valid' ) ); 1398 } 1397 1399 1398 1399 1400 if ( ! current_user_can( $post_type->cap->edit_posts ) ) 1401 return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts in this post type' )); 1400 1402 1401 $query['post_type'] = $filter['post_type']; 1402 } 1403 $query['post_type'] = $post_type->name; 1403 1404 1404 1405 if ( isset( $filter['post_status'] ) ) 1405 1406 $query['post_status'] = $filter['post_status'];