summaryrefslogtreecommitdiff
path: root/inc/compatibility/class-astra-yoast-seo.php
blob: e2bf3e6aab4cf077e338f9a83a3287675ea72198 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
 * Yoast SEO Compatibility File.
 *
 * @package Astra
 */

/**
 * Astra Yoast SEO Compatibility
 *
 * @since 2.1.2
 */
class Astra_Yoast_SEO {

	/**
	 * Constructor
	 */
	public function __construct() {
		add_filter( 'wpseo_sitemap_exclude_post_type', array( $this, 'sitemap_exclude_post_type' ), 10, 2 );
	}

	/**
	 * Exclude One Content Type From Yoast SEO Sitemap
	 *
	 * @param  string $value value.
	 * @param  string $post_type Post Type.
	 * @since 2.1.2
	 */
	public function sitemap_exclude_post_type( $value, $post_type ) {
		if ( 'astra-advanced-hook' === $post_type ) {
			return true;
		}
	}

}

/**
 * Kicking this off by object
 */
new Astra_Yoast_SEO();