Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 809-818 (lines=10) @@
806
		return $_user->ID;
807
	}
808
809
	protected function should_load_theme_functions( $post_id = null ) {
810
		if ( empty( $post_id ) ) {
811
			$input = $this->input( true );
812
			$type = $input['type'];
813
		} else {
814
			$type = get_post_type( $post_id );
815
		}
816
817
		return ! empty( $type ) && ! in_array( $type, array( 'post', 'revision' ) );
818
	}
819
}
820

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

@@ 707-716 (lines=10) @@
704
		return $return;
705
	}
706
707
	protected function should_load_theme_functions( $post_id = null ) {
708
		if ( empty( $post_id ) ) {
709
			$input = $this->input( true );
710
			$type = $input['type'];
711
		} else {
712
			$type = get_post_type( $post_id );
713
		}
714
715
		return ! empty( $type ) && ! in_array( $type, array( 'post', 'revision' ) );
716
	}
717
}
718