Completed
Pull Request — develop (#1336)
by Naveen
02:57
created

Entity_Taxonomy_No_Index   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
1
<?php
2
3
namespace Wordlift\Entity;
4
/**
5
 * @since 3.28.0
6
 * @author Naveen Muthusamy <[email protected]>
7
 */
8
9
/**
10
 * Filter to remove the entity taxonomy from sitemap.
11
 * Class Entity_Taxonomy_No_Index
12
 * @package Wordlift\Entity
13
 */
14
class Entity_Taxonomy_No_Index {
15
16
	public function __construct() {
17
18
		add_filter( 'wp_sitemaps_taxonomies', function ( $taxonomies ) {
19
			$entity_taxonomy = \Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME;
20
			if ( array_key_exists( $entity_taxonomy, $taxonomies ) ) {
21
				unset( $taxonomies[ $entity_taxonomy ] );
22
			}
23
			return $taxonomies;
24
		} );
25
26
	}
27
28
}
29