| 1 |
<?php |
| 2 |
/** |
| 3 |
* WPSEO plugin file. |
| 4 |
* |
| 5 |
* @package WPSEO\Frontend |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* Adds customizations to the front end for the primary category. |
| 10 |
* |
| 11 |
* @deprecated 14.0 |
| 12 |
*/ |
| 13 |
class WPSEO_Frontend_Primary_Category implements WPSEO_WordPress_Integration { |
| 14 |
|
| 15 |
/** |
| 16 |
* Registers the hooks necessary for correct primary category behaviour. |
| 17 |
*/ |
| 18 |
public function register_hooks() { |
| 19 |
add_filter( 'post_link_category', [ $this, 'post_link_category' ], 10, 3 ); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Filters post_link_category to change the category to the chosen category by the user. |
| 24 |
* |
| 25 |
* @deprecated 14.0 |
| 26 |
* @codeCoverageIgnore |
| 27 |
* |
| 28 |
* @param stdClass $category The category that is now used for the post link. |
| 29 |
* @param array|null $categories This parameter is not used. |
| 30 |
* @param WP_Post|null $post The post in question. |
| 31 |
* |
| 32 |
* @return array|object|WP_Error|null The category we want to use for the post link. |
| 33 |
*/ |
| 34 |
public function post_link_category( $category, $categories = null, $post = null ) { |
| 35 |
_deprecated_function( __METHOD__, 'WPSEO 14.0' ); |
| 36 |
|
| 37 |
return $category; |
| 38 |
} |
| 39 |
} |
| 40 |
|