@@ 5069-5074 (lines=6) @@ | ||
5066 | if ( isset($content_struct['custom_fields']) ) |
|
5067 | $this->set_custom_fields($post_ID, $content_struct['custom_fields']); |
|
5068 | ||
5069 | if ( isset ( $content_struct['wp_post_thumbnail'] ) ) { |
|
5070 | if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) |
|
5071 | return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); |
|
5072 | ||
5073 | unset( $content_struct['wp_post_thumbnail'] ); |
|
5074 | } |
|
5075 | ||
5076 | // Handle enclosures |
|
5077 | $thisEnclosure = isset($content_struct['enclosure']) ? $content_struct['enclosure'] : null; |
|
@@ 5429-5434 (lines=6) @@ | ||
5426 | if ( isset ( $content_struct['wp_post_thumbnail'] ) ) { |
|
5427 | ||
5428 | // Empty value deletes, non-empty value adds/updates. |
|
5429 | if ( empty( $content_struct['wp_post_thumbnail'] ) ) { |
|
5430 | delete_post_thumbnail( $post_ID ); |
|
5431 | } else { |
|
5432 | if ( set_post_thumbnail( $post_ID, $content_struct['wp_post_thumbnail'] ) === false ) |
|
5433 | return new IXR_Error( 404, __( 'Invalid attachment ID.' ) ); |
|
5434 | } |
|
5435 | unset( $content_struct['wp_post_thumbnail'] ); |
|
5436 | } |
|
5437 |