Ticket #5569: xmlrpc.php.2.diff

File xmlrpc.php.2.diff, 1.7 KB (added by josephscott, 4 years ago)
  • xmlrpc.php

     
    11911191                $post_content = apply_filters( 'content_save_pre', $content_struct['description'] ); 
    11921192 
    11931193                $post_status = $publish ? 'publish' : 'draft'; 
    1194                 if( isset( $content_struct['post_status'] ) ) { 
    1195                         switch( $content_struct['post_status'] ) { 
     1194 
     1195                if( isset( $content_struct["{$post_type}_status"] ) ) { 
     1196                        switch( $content_struct["{$post_type}_status"] ) { 
    11961197                                case 'draft': 
    11971198                                case 'private': 
    11981199                                case 'publish': 
    1199                                         $post_status = $content_struct['post_status']; 
     1200                                        $post_status = $content_struct["{$post_type}_status"]; 
    12001201                                        break; 
    12011202                                case 'pending': 
    12021203                                        // Pending is only valid for posts, not pages. 
    12031204                                        if( $post_type === 'post' ) { 
    1204                                                 $post_status = $content_struct['post_status']; 
     1205                                                $post_status = $content_struct["{$post_type}_status"]; 
    12051206                                        } 
    12061207                                        break; 
    12071208                                default: 
     
    15101511                $post_more = $content_struct['mt_text_more']; 
    15111512 
    15121513                $post_status = $publish ? 'publish' : 'draft'; 
    1513                 if( isset( $content_struct['post_status'] ) ) { 
    1514                         switch( $content_struct['post_status'] ) { 
     1514                if( isset( $content_struct["{$post_type}_status"] ) ) { 
     1515                        switch( $content_struct["{$post_type}_status"] ) { 
    15151516                                case 'draft': 
    15161517                                case 'private': 
    15171518                                case 'publish': 
    1518                                         $post_status = $content_struct['post_status']; 
     1519                                        $post_status = $content_struct["{$post_type}_status"]; 
    15191520                                        break; 
    15201521                                case 'pending': 
    15211522                                        // Pending is only valid for posts, not pages. 
    15221523                                        if( $post_type === 'post' ) { 
    1523                                                 $post_status = $content_struct['post_status']; 
     1524                                                $post_status = $content_struct["{$post_type}_status"]; 
    15241525                                        } 
    15251526                                        break; 
    15261527                                default: