WordPress.org

Make WordPress Core

Ticket #15098: xmlrpc_patch.diff

File xmlrpc_patch.diff, 820 bytes (added by rvavruch, 4 years ago)

Return an id when performing a metaWeblog.newMediaObject

  • wp-includes/class.wp-xmlrpc-server.php

     
    27362736                $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); 
    27372737                wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); 
    27382738 
    2739                 return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type ), 'upload' ); 
     2739                return apply_filters( 'wp_handle_upload', array( 'file' => $name, 'url' => $upload[ 'url' ], 'type' => $type, 'id' => $id ), 'upload' ); 
    27402740        } 
    27412741 
    27422742        /* MovableType API functions 
     
    32433243                return $pingbacks; 
    32443244        } 
    32453245} 
    3246 ?> 
    3247  No newline at end of file 
     3246?>