| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\Integrations\Front_End; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\Conditionals\Front_End_Conditional; |
| 6 |
use Yoast\WP\SEO\Integrations\Integration_Interface; |
| 7 |
|
| 8 |
/** |
| 9 |
* Notify the user by giving a deprecated notice. |
| 10 |
*/ |
| 11 |
class Theme_Titles implements Integration_Interface { |
| 12 |
|
| 13 |
/** |
| 14 |
* Returns the conditionals based in which this loadable should be active. |
| 15 |
* |
| 16 |
* @return array |
| 17 |
*/ |
| 18 |
public static function get_conditionals() { |
| 19 |
return [ Front_End_Conditional::class ]; |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Initializes the integration. |
| 24 |
* |
| 25 |
* This is the place to register hooks and filters. |
| 26 |
* |
| 27 |
* @return void |
| 28 |
*/ |
| 29 |
public function register_hooks() { |
| 30 |
\add_filter( 'thematic_doctitle', [ $this, 'title' ], 15 ); |
| 31 |
\add_filter( 'woo_title', [ $this, 'title' ], 99 ); |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Filters the title for woo_title and the thematic_doctitle. |
| 36 |
* |
| 37 |
* @deprecated 14.0 |
| 38 |
* |
| 39 |
* @codeCoverageIgnore |
| 40 |
* |
| 41 |
* @param string $title The title. |
| 42 |
* |
| 43 |
* @return string The title. |
| 44 |
*/ |
| 45 |
public function title( $title ) { |
| 46 |
\_deprecated_function( |
| 47 |
__METHOD__, |
| 48 |
'WPSEO 14.0', |
| 49 |
\esc_html__( |
| 50 |
'a theme that has proper title-tag theme support, or adapt your theme to have that support', |
| 51 |
'wordpress-seo' |
| 52 |
) |
| 53 |
); |
| 54 |
|
| 55 |
return $title; |
| 56 |
} |
| 57 |
} |
| 58 |
|