Code Duplication    Length = 6-6 lines in 2 locations

modules/sitemaps/sitemap-builder.php 2 locations

@@ 1149-1154 (lines=6) @@
1146
1147
		// Do not include the image if the attached parent is not published.
1148
		// Unattached will be published. Otherwise, will inherit parent status.
1149
		if ( 'publish' !== get_post_status( $post ) ) {
1150
			return array(
1151
				'xml'           => null,
1152
				'last_modified' => null,
1153
			);
1154
		}
1155
1156
		$parent_url = get_permalink( get_post( $post->post_parent ) );
1157
		if ( '' == $parent_url ) { // WPCS: loose comparison ok.
@@ 1233-1238 (lines=6) @@
1230
1231
		// Do not include the video if the attached parent is not published.
1232
		// Unattached will be published. Otherwise, will inherit parent status.
1233
		if ( 'publish' !== get_post_status( $post ) ) {
1234
			return array(
1235
				'xml'           => null,
1236
				'last_modified' => null,
1237
			);
1238
		}
1239
1240
		$parent_url = esc_url( get_permalink( get_post( $post->post_parent ) ) );
1241
		if ( '' == $parent_url ) { // WPCS: loose comparison ok.