Code Duplication    Length = 9-10 lines in 2 locations

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

@@ 350-358 (lines=9) @@
347
		$post = $post_object;
348
		// return non existant post
349
		$post_type = get_post_type_object( $post->post_type );
350
		if ( empty( $post_type ) || ! is_object( $post_type ) ) {
351
			$non_existant_post                    = new stdClass();
352
			$non_existant_post->ID                = $post->ID;
353
			$non_existant_post->post_modified     = $post->post_modified;
354
			$non_existant_post->post_modified_gmt = $post->post_modified_gmt;
355
			$non_existant_post->post_status       = 'jetpack_sync_non_registered_post_type';
356
			return $non_existant_post;
357
		}
358
		/**
359
		 * Filters whether to prevent sending post data to .com
360
		 *
361
		 * Passing true to the filter will prevent the post data from being sent
@@ 371-380 (lines=10) @@
368
		 * @param boolean false prevent post data from being synced to WordPress.com
369
		 * @param mixed $post WP_POST object
370
		 */
371
		if ( apply_filters( 'jetpack_sync_prevent_sending_post_data', false, $post ) ) {
372
			// We only send the bare necessary object to be able to create a checksum.
373
			$blocked_post                    = new stdClass();
374
			$blocked_post->ID                = $post->ID;
375
			$blocked_post->post_modified     = $post->post_modified;
376
			$blocked_post->post_modified_gmt = $post->post_modified_gmt;
377
			$blocked_post->post_status       = 'jetpack_sync_blocked';
378
			return $blocked_post;
379
		}
380
		// lets not do oembed just yet.
381
		$this->remove_embed();
382
		if ( 0 < strlen( $post->post_password ) ) {
383
			$post->post_password = 'auto-' . wp_generate_password( 10, false );