Code Duplication    Length = 6-6 lines in 2 locations

modules/sitemaps/sitemap-builder.php 2 locations

@@ 1214-1219 (lines=6) @@
1211
1212
		// Do not include the image if the attached parent is not published.
1213
		// Unattached will be published. Otherwise, will inherit parent status.
1214
		if ( 'publish' !== get_post_status( $post ) ) {
1215
			return array(
1216
				'xml'           => null,
1217
				'last_modified' => null,
1218
			);
1219
		}
1220
1221
		$parent_url = get_permalink( get_post( $post->post_parent ) );
1222
		if ( '' == $parent_url ) { // WPCS: loose comparison ok.
@@ 1298-1303 (lines=6) @@
1295
1296
		// Do not include the video if the attached parent is not published.
1297
		// Unattached will be published. Otherwise, will inherit parent status.
1298
		if ( 'publish' !== get_post_status( $post ) ) {
1299
			return array(
1300
				'xml'           => null,
1301
				'last_modified' => null,
1302
			);
1303
		}
1304
1305
		$parent_url = esc_url( get_permalink( get_post( $post->post_parent ) ) );
1306
		if ( '' == $parent_url ) { // WPCS: loose comparison ok.