Code Duplication    Length = 9-9 lines in 2 locations

modules/videopress-v2/editor-media-view.php 1 location

@@ 124-132 (lines=9) @@
121
 * Make sure that any Video that has a VideoPress GUID passes that data back.
122
 */
123
add_filter( 'wp_prepare_attachment_for_js', 'videopress_prepare_attachment_for_js' );
124
function videopress_prepare_attachment_for_js( $post ) {
125
	if ( 'video' === $post['type'] ) {
126
		$guid = get_post_meta( $post['id'], 'videopress_guid' );
127
		if ( $guid ) {
128
			$post['videopress_guid'] = $guid;
129
		}
130
	}
131
	return $post;
132
}
133
134
/**
135
 * Wherever the Media Modal is deployed, also deploy our overrides.

modules/videopress/editor-media-view.php 1 location

@@ 124-132 (lines=9) @@
121
 * Make sure that any Video that has a VideoPress GUID passes that data back.
122
 */
123
add_filter( 'wp_prepare_attachment_for_js', 'videopress_prepare_attachment_for_js' );
124
function videopress_prepare_attachment_for_js( $post ) {
125
	if ( 'video' === $post['type'] ) {
126
		$guid = get_post_meta( $post['id'], 'videopress_guid' );
127
		if ( $guid ) {
128
			$post['videopress_guid'] = $guid;
129
		}
130
	}
131
	return $post;
132
}
133
134
/**
135
 * Wherever the Media Modal is deployed, also deploy our overrides.