Ticket #20662: 20662.4.diff
File 20662.4.diff, 1.7 KB (added by , 10 years ago) |
---|
-
src/wp-includes/class-wp-xmlrpc-server.php
5281 5281 if ( $post_type == 'post' && isset( $content_struct['sticky'] ) ) { 5282 5282 $data = $newpost; 5283 5283 $data['sticky'] = $content_struct['sticky']; 5284 $data['post_type'] = 'post'; 5284 5285 $error = $this->_toggle_sticky( $data, true ); 5285 5286 if ( $error ) { 5286 5287 return $error; -
tests/phpunit/tests/xmlrpc/mw/editPost.php
113 113 $out = get_post( $post_id ); 114 114 $this->assertEquals( $editor_id, $out->post_author ); 115 115 } 116 116 117 117 function test_post_thumbnail() { 118 118 add_theme_support( 'post-thumbnails' ); 119 119 … … 203 203 $this->assertEquals( $post4['mt_excerpt'], $out->post_excerpt ); 204 204 } 205 205 206 /** 207 * @ticket 20662 208 */ 209 function test_make_post_sticky() { 210 $author_id = $this->make_user_by_role( 'editor' ); 211 212 $post = array( 'post_title' => 'Title', 'post_content' => 'Content', 'post_author' => $author_id, 'post_status' => 'publish' ); 213 $post_id = wp_insert_post( $post ); 214 215 $result = $this->myxmlrpcserver->mw_editPost( array( $post_id, 'editor', 'editor', array( 'sticky' => '1' ) ) ); 216 $this->assertNotInstanceOf( 'IXR_Error', $result ); 217 $this->assertTrue( $result ); 218 } 219 206 220 // Not allowed since [19914] 207 221 function test_change_post_type() { 208 222 $contributor_id = $this->make_user_by_role( 'contributor' );