Code Duplication    Length = 9-10 lines in 2 locations

sync/class.jetpack-sync-module-posts.php 2 locations

@@ 254-262 (lines=9) @@
251
252
		// return non existant post
253
		$post_type = get_post_type_object( $post->post_type );
254
		if ( empty( $post_type ) || ! is_object( $post_type ) ) {
255
			$non_existant_post                    = new stdClass();
256
			$non_existant_post->ID                = $post->ID;
257
			$non_existant_post->post_modified     = $post->post_modified;
258
			$non_existant_post->post_modified_gmt = $post->post_modified_gmt;
259
			$non_existant_post->post_status       = 'jetpack_sync_non_registered_post_type';
260
261
			return $non_existant_post;
262
		}
263
		/**
264
		 * Filters whether to prevent sending post data to .com
265
		 *
@@ 276-285 (lines=10) @@
273
		 * @param boolean false prevent post data from being synced to WordPress.com
274
		 * @param mixed $post WP_POST object
275
		 */
276
		if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) {
277
			// We only send the bare necessary object to be able to create a checksum.
278
			$blocked_post                    = new stdClass();
279
			$blocked_post->ID                = $post->ID;
280
			$blocked_post->post_modified     = $post->post_modified;
281
			$blocked_post->post_modified_gmt = $post->post_modified_gmt;
282
			$blocked_post->post_status       = 'jetpack_sync_blocked';
283
284
			return $blocked_post;
285
		}
286
287
		// lets not do oembed just yet.
288
		$this->remove_embed();