Code Duplication    Length = 7-7 lines in 2 locations

json-endpoints/class.wpcom-json-api-edit-media-v1-2-endpoint.php 1 location

@@ 53-59 (lines=7) @@
50
			}
51
		}
52
53
		if ( ! empty( $id3_meta ) ) {
54
			// Before updating metadata, ensure that the item is audio
55
			$item = $this->get_media_item_v1_1( $media_id );
56
			if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
57
				wp_update_attachment_metadata( $media_id, $id3_meta );
58
			}
59
		}
60
61
		return $update_action;
62
	}

class.json-api-endpoints.php 1 location

@@ 1740-1746 (lines=7) @@
1737
					}
1738
				}
1739
1740
				if ( ! empty( $id3_meta ) ) {
1741
					// Before updating metadata, ensure that the item is audio
1742
					$item = $this->get_media_item_v1_1( $media_id );
1743
					if ( 0 === strpos( $item->mime_type, 'audio/' ) ) {
1744
						wp_update_attachment_metadata( $media_id, $id3_meta );
1745
					}
1746
				}
1747
			}
1748
		}
1749