WordPress.org

Make WordPress Core

Changeset 33612


Ignore:
Timestamp:
08/13/2015 03:27:57 PM (6 years ago)
Author:
wonderboymusic
Message:

After [33325], supply a missing post_type in ->mw_editPost().

Add unit test.

Props ocean90.
Fixes #20662.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r33407 r33612  
    52825282            $data = $newpost;
    52835283            $data['sticky'] = $content_struct['sticky'];
     5284            $data['post_type'] = 'post';
    52845285            $error = $this->_toggle_sticky( $data, true );
    52855286            if ( $error ) {
  • trunk/tests/phpunit/tests/xmlrpc/mw/editPost.php

    r31983 r33612  
    114114        $this->assertEquals( $editor_id, $out->post_author );
    115115    }
    116    
     116
    117117    function test_post_thumbnail() {
    118118        add_theme_support( 'post-thumbnails' );
     
    204204    }
    205205
     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
    206220    // Not allowed since [19914]
    207221    function test_change_post_type() {
Note: See TracChangeset for help on using the changeset viewer.