Code Duplication    Length = 7-7 lines in 2 locations

json-endpoints/class.wpcom-json-api-update-post-v1-1-endpoint.php 1 location

@@ 347-353 (lines=7) @@
344
		}
345
346
		// set page template for this post..
347
		if ( isset( $input['page_template'] ) && 'page' == $post_type->name ) {
348
			$page_template = $input['page_template'];
349
			$page_templates = wp_get_theme()->get_page_templates( get_post( $post_id ) );
350
			if ( empty( $page_template ) || 'default' == $page_template || isset( $page_templates[ $page_template ] ) ) {
351
				update_post_meta( $post_id, '_wp_page_template', $page_template );
352
			}
353
		}
354
355
		// Set like status for the post
356
		/** This filter is documented in modules/likes.php */

json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php 1 location

@@ 347-353 (lines=7) @@
344
		}
345
346
		// set page template for this post..
347
		if ( isset( $input['page_template'] ) && 'page' == $post_type->name ) {
348
			$page_template = $input['page_template'];
349
			$page_templates = wp_get_theme()->get_page_templates( get_post( $post_id ) );
350
			if ( empty( $page_template ) || 'default' == $page_template || isset( $page_templates[ $page_template ] ) ) {
351
				update_post_meta( $post_id, '_wp_page_template', $page_template );
352
			}
353
		}
354
355
		// Set like status for the post
356
		/** This filter is documented in modules/likes.php */