| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Initializers; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\Conditionals\No_Conditionals; |
| 6 |
|
| 7 |
/** |
| 8 |
* Adds custom headers to the list of plugin headers to read. |
| 9 |
*/ |
| 10 |
class Plugin_Headers implements Initializer_Interface { |
| 11 |
|
| 12 |
use No_Conditionals; |
| 13 |
|
| 14 |
/** |
| 15 |
* Hooks into the list of the plugin headers. |
| 16 |
* |
| 17 |
* @return void |
| 18 |
*/ |
| 19 |
public function initialize() { |
| 20 |
\add_filter( 'extra_plugin_headers', [ $this, 'add_requires_yoast_seo_header' ] ); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Add the `Requires Yoast SEO` header to the list of headers. |
| 25 |
* |
| 26 |
* @param array<string> $headers The headers. |
| 27 |
* |
| 28 |
* @return array<string> The updated headers. |
| 29 |
*/ |
| 30 |
public function add_requires_yoast_seo_header( $headers ) { |
| 31 |
$headers[] = 'Requires Yoast SEO'; |
| 32 |
return $headers; |
| 33 |
} |
| 34 |
} |
| 35 |
|