Code Duplication    Length = 17-17 lines in 2 locations

projects/packages/post-images/src/class-post-images.php 1 location

@@ 786-802 (lines=17) @@
783
	 * }
784
	 */
785
	public static function get_post_html( $html_or_id ) {
786
		if ( is_numeric( $html_or_id ) ) {
787
			$post = get_post( $html_or_id );
788
789
			if ( empty( $post ) || ! empty( $post->post_password ) ) {
790
				return '';
791
			}
792
793
			$html_info = array(
794
				'html'     => $post->post_content, // DO NOT apply the_content filters here, it will cause loops.
795
				'post_url' => get_permalink( $post->ID ),
796
			);
797
		} else {
798
			$html_info = array(
799
				'html'     => $html_or_id,
800
				'post_url' => '',
801
			);
802
		}
803
		return $html_info;
804
	}
805

projects/plugins/jetpack/class.jetpack-post-images.php 1 location

@@ 798-814 (lines=17) @@
795
	static function get_post_html( $html_or_id ) {
796
		_deprecated_function( __METHOD__, 'jetpack-9.7.0', 'Automattic\Jetpack\Post_Images::get_post_html' );
797
798
		if ( is_numeric( $html_or_id ) ) {
799
			$post = get_post( $html_or_id );
800
801
			if ( empty( $post ) || ! empty( $post->post_password ) ) {
802
				return '';
803
			}
804
805
			$html_info = array(
806
				'html'     => $post->post_content, // DO NOT apply the_content filters here, it will cause loops.
807
				'post_url' => get_permalink( $post->ID ),
808
			);
809
		} else {
810
			$html_info = array(
811
				'html'     => $html_or_id,
812
				'post_url' => '',
813
			);
814
		}
815
		return $html_info;
816
	}
817