Changeset 20462
- Timestamp:
- 04/13/2012 08:23:31 PM (14 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/class-wp-xmlrpc-server.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/class-wp-xmlrpc-server.php
r20406 r20462 345 345 'option' => 'stylesheet' 346 346 ), 347 ' featured_image' => array(348 'desc' => __(' Featured Image'),347 'post_thumbnail' => array( 348 'desc' => __('Post Thumbnail'), 349 349 'readonly' => true, 350 350 'value' => current_theme_supports( 'post-thumbnails' ) … … 596 596 597 597 // 598 $post_fields[' featured_image'] = get_post_meta( $post['ID'], '_thumbnail_id', true );599 $post_fields[' featured_image_url'] = wp_get_attachment_url( $post_fields['featured_image'] );598 $post_fields['post_thumbnail'] = get_post_meta( $post['ID'], '_thumbnail_id', true ); 599 $post_fields['post_thumbnail_url'] = wp_get_attachment_url( $post_fields['post_thumbnail'] ); 600 600 601 601 // Consider future posts as published … … 723 723 * - ping_status - can be 'open' | 'closed' 724 724 * - sticky 725 * - featured_image - ID of a media item to use as thefeatured image725 * - post_thumbnail - ID of a media item to use as the post thumbnail/featured image 726 726 * - custom_fields - array, with each element containing 'key' and 'value' 727 727 * - terms - array, with taxonomy names as keys and arrays of term IDs as values … … 857 857 } 858 858 859 if ( isset ( $post_data[' featured_image'] ) ) {859 if ( isset ( $post_data['post_thumbnail'] ) ) { 860 860 // empty value deletes, non-empty value adds/updates 861 if ( empty( $post_data[' featured_image'] ) ) {861 if ( empty( $post_data['post_thumbnail'] ) ) { 862 862 delete_post_thumbnail( $post_ID ); 863 863 } 864 864 else { 865 if ( set_post_thumbnail( $post_ID, $post_data[' featured_image'] ) === false )865 if ( set_post_thumbnail( $post_ID, $post_data['post_thumbnail'] ) === false ) 866 866 return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); 867 867 } 868 unset( $content_struct[' featured_image'] );868 unset( $content_struct['post_thumbnail'] ); 869 869 } 870 870 … … 3504 3504 * - date_created_gmt 3505 3505 * - dateCreated 3506 * - wp_ featured_image3506 * - wp_post_thumbnail 3507 3507 * 3508 3508 * @since 1.5.0 … … 3754 3754 $this->set_custom_fields($post_ID, $content_struct['custom_fields']); 3755 3755 3756 if ( isset ( $content_struct['wp_ featured_image'] ) ) {3757 if ( set_post_thumbnail( $post_ID, $content_struct['wp_ featured_image'] ) === false )3756 if ( isset ( $content_struct['wp_post_thumbnail'] ) ) { 3757 if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) 3758 3758 return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); 3759 3759 3760 unset( $content_struct['wp_ featured_image'] );3760 unset( $content_struct['wp_post_thumbnail'] ); 3761 3761 } 3762 3762 … … 4067 4067 $this->set_custom_fields($post_ID, $content_struct['custom_fields']); 4068 4068 4069 if ( isset ( $content_struct['wp_ featured_image'] ) ) {4069 if ( isset ( $content_struct['wp_post_thumbnail'] ) ) { 4070 4070 // empty value deletes, non-empty value adds/updates 4071 if ( empty( $content_struct['wp_ featured_image'] ) ) {4071 if ( empty( $content_struct['wp_post_thumbnail'] ) ) { 4072 4072 delete_post_thumbnail( $post_ID ); 4073 4073 } else { 4074 if ( set_post_thumbnail( $post_ID, $content_struct['wp_ featured_image'] ) === false )4074 if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) 4075 4075 return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); 4076 4076 } 4077 unset( $content_struct['wp_ featured_image'] );4077 unset( $content_struct['wp_post_thumbnail'] ); 4078 4078 } 4079 4079 … … 4208 4208 if ( !empty($enclosure) ) $resp['enclosure'] = $enclosure; 4209 4209 4210 $resp['wp_ featured_image'] = get_post_meta( $postdata['ID'], '_thumbnail_id', true );4211 $resp['wp_ featured_image_url'] = wp_get_attachment_url( $resp['wp_featured_image'] );4210 $resp['wp_post_thumbnail'] = get_post_meta( $postdata['ID'], '_thumbnail_id', true ); 4211 $resp['wp_post_thumbnail_url'] = wp_get_attachment_url( $resp['wp_post_thumbnail'] ); 4212 4212 4213 4213 return $resp; … … 4320 4320 4321 4321 $entry_index = count( $struct ) - 1; 4322 $struct[ $entry_index ][ 'wp_ featured_image' ] = get_post_meta( $entry['ID'], '_thumbnail_id', true );4323 $struct[ $entry_index ][ 'wp_ featured_image_url' ] = wp_get_attachment_url( $struct[ $entry_index ][ 'wp_featured_image' ] );4322 $struct[ $entry_index ][ 'wp_post_thumbnail' ] = get_post_meta( $entry['ID'], '_thumbnail_id', true ); 4323 $struct[ $entry_index ][ 'wp_post_thumbnail_url' ] = wp_get_attachment_url( $struct[ $entry_index ][ 'wp_post_thumbnail' ] ); 4324 4324 } 4325 4325
Note: See TracChangeset
for help on using the changeset viewer.