Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 414-420 (lines=7) @@
411
		}
412
413
		// set page template for this post..
414
		if ( isset( $input['page_template'] ) && 'page' == $post_type->name ) {
415
			$page_template = $input['page_template'];
416
			$page_templates = wp_get_theme()->get_page_templates( get_post( $post_id ) );
417
			if ( empty( $page_template ) || 'default' == $page_template || isset( $page_templates[ $page_template ] ) ) {
418
				update_post_meta( $post_id, '_wp_page_template', $page_template );
419
			}
420
		}
421
422
		// Set like status for the post
423
		/** This filter is documented in modules/likes.php */

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

@@ 415-421 (lines=7) @@
412
		}
413
414
		// set page template for this post..
415
		if ( isset( $input['page_template'] ) && 'page' == $post_type->name ) {
416
			$page_template = $input['page_template'];
417
			$page_templates = wp_get_theme()->get_page_templates( get_post( $post_id ) );
418
			if ( empty( $page_template ) || 'default' == $page_template || isset( $page_templates[ $page_template ] ) ) {
419
				update_post_meta( $post_id, '_wp_page_template', $page_template );
420
			}
421
		}
422
423
		// Set like status for the post
424
		/** This filter is documented in modules/likes.php */