Code Duplication    Length = 7-7 lines in 2 locations

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

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

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

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