Skip to content

Commit

Permalink
Added missing fields from _prepare_post (see [WP21526]).
Browse files Browse the repository at this point in the history
  • Loading branch information
maxcutler committed Dec 3, 2012
1 parent c4f98c7 commit 20842da
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions class-wp-xmlrpc-server-ext.php
Expand Up @@ -64,6 +64,7 @@ function wxm_xmlrpc_methods( $methods ) {
$methods['wp.newPost'] = array( &$this, 'wxm_wp_newPost' );
$methods['wp.editPost'] = array( &$this, 'wxm_wp_editPost' );
$methods['wp.getPosts'] = array( &$this, 'wxm_wp_getPosts' );
$methods['wp.getPost'] = array( &$this, 'wxm_wp_getPost' );
}

// array_merge will take the values defined in later arguments, so
Expand Down Expand Up @@ -198,7 +199,11 @@ protected function wxm_prepare_post( $post, $fields ) {
'post_password' => $post['post_password'],
'post_excerpt' => $post['post_excerpt'],
'post_content' => $post['post_content'],
'post_parent' => strval( $post['post_parent'] ),
'post_mime_type' => $post['post_mime_type'],
'link' => post_permalink( $post['ID'] ),
'guid' => $post['guid'],
'menu_order' => intval( $post['menu_order'] ),
'comment_status' => $post['comment_status'],
'ping_status' => $post['ping_status'],
'sticky' => ( $post['post_type'] === 'post' && is_sticky( $post['ID'] ) ),
Expand Down Expand Up @@ -1410,7 +1415,7 @@ function wxm_wp_getPost( $args ) {
if ( ! current_user_can( $post_type->cap->edit_posts, $post_id ) )
return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );

return $this->_prepare_post( $post, $fields );
return $this->wxm_prepare_post( $post, $fields );
}

/**
Expand Down Expand Up @@ -1502,7 +1507,7 @@ function wxm_wp_getPosts( $args ) {
if ( ! current_user_can( $post_type->cap->edit_posts, $post['ID'] ) )
continue;

$struct[] = $this->_prepare_post( $post, $fields );
$struct[] = $this->wxm_prepare_post( $post, $fields );
}

return $struct;
Expand Down Expand Up @@ -2132,7 +2137,7 @@ function wxm_wp_getRevisions( $args ) {
if ( wp_is_post_autosave( $revision ) )
continue;

$struct[] = $this->_prepare_post( get_object_vars( $revision ), $fields );
$struct[] = $this->wxm_prepare_post( get_object_vars( $revision ), $fields );
}

return $struct;
Expand Down

0 comments on commit 20842da

Please sign in to comment.