Changeset 34580
- Timestamp:
- 09/26/2015 05:30:34 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-xmlrpc-server.php
r34579 r34580 1935 1935 } 1936 1936 1937 if ( isset( $content_struct['parent'] ) ) {1937 if ( ! empty( $content_struct['parent'] ) ) { 1938 1938 if ( ! $taxonomy['hierarchical'] ) 1939 1939 return new IXR_Error( 403, __( "This taxonomy is not hierarchical so you can't set a parent." ) ); -
trunk/tests/phpunit/tests/xmlrpc/wp/editTerm.php
r25002 r34580 93 93 94 94 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => '', 'name' => 'test' ) ) ); 95 $this->assertInstanceOf( 'IXR_Error', $result ); 96 $this->assertEquals( 500, $result->code ); 97 $this->assertEquals( __('Empty Term'), $result->message ); 95 $this->assertNotInstanceOf( 'IXR_Error', $result ); 96 $this->assertTrue( $result ); 97 } 98 99 function test_parent_null() { 100 $this->make_user_by_role( 'editor' ); 101 102 $result = $this->myxmlrpcserver->wp_editTerm( array( 1, 'editor', 'editor', $this->child_term['term_id'], array( 'taxonomy' => 'category', 'parent' => NULL, 'name' => 'test' ) ) ); 103 104 $this->assertNotInstanceOf( 'IXR_Error', $result ); 105 $this->assertInternalType( 'boolean', $result ); 106 107 $term = get_term( $this->child_term['term_id'], 'category' ); 108 $this->assertEquals( '0', $term->parent ); 98 109 } 99 110
Note: See TracChangeset
for help on using the changeset viewer.