Changeset 27554
- Timestamp:
- 03/15/2014 05:08:40 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r27553 r27554 1132 1132 1133 1133 $term_ids = $post_data['terms'][$taxonomy]; 1134 $terms[ $taxonomy ] = array(); 1134 1135 foreach ( $term_ids as $term_id ) { 1135 1136 $term = get_term_by( 'id', $term_id, $taxonomy ); -
trunk/tests/phpunit/tests/xmlrpc/wp/editPost.php
r25002 r27554 310 310 311 311 /** 312 * @ticket 26686 313 */ 314 function test_clear_categories_on_edit() { 315 $editor_id = $this->make_user_by_role( 'editor' ); 316 317 $post_id = $this->factory->post->create( array( 'post_author' => $editor_id ) ); 318 $term_id = $this->factory->category->create(); 319 $this->factory->term->add_post_terms( $post_id, $term_id, 'category', true ); 320 $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' ); 321 $this->assertContains( $term_id, $term_ids ); 322 323 $new_post_content = array( 324 'ID' => $post_id, 325 'post_title' => 'Updated', 326 'terms' => array( 327 'category' => array() 328 ) 329 ); 330 $result = $this->myxmlrpcserver->wp_editPost( array( 1, 'editor', 'editor', $post_id, $new_post_content ) ); 331 $this->assertNotInstanceOf( 'IXR_Error', $result ); 332 $this->assertEquals( 'Updated', get_post( $post_id )->post_title ); 333 334 $term_ids = wp_list_pluck( get_the_category( $post_id ), 'term_id' ); 335 $this->assertNotContains( $term_id, $term_ids ); 336 } 337 338 /** 312 339 * @ticket 23219 313 340 */
Note: See TracChangeset
for help on using the changeset viewer.