| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | // phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps |
| 6 | use MediaWiki\Title\Title; |
| 7 | |
| 8 | /** |
| 9 | * This is a hook handler interface, see docs/Hooks.md. |
| 10 | * Use the hook name "CategoryViewer::generateLink" to register handlers implementing this interface. |
| 11 | * |
| 12 | * @stable to implement |
| 13 | * @ingroup Hooks |
| 14 | */ |
| 15 | interface CategoryViewer__generateLinkHook { |
| 16 | /** |
| 17 | * This hook is called before generating an output link allow |
| 18 | * extensions opportunity to generate a more specific or relevant link. |
| 19 | * |
| 20 | * @since 1.35 |
| 21 | * |
| 22 | * @param string $type Category type, either 'page', 'file', or 'subcat' |
| 23 | * @param Title $title Categorized page |
| 24 | * @param string $html Requested HTML content of anchor |
| 25 | * @param string &$link Returned value. When set to a non-null value by a hook subscriber, |
| 26 | * this value will be used as the anchor instead of LinkRenderer::makeLink. |
| 27 | * @return bool|void True or no return value to continue or false to abort |
| 28 | */ |
| 29 | public function onCategoryViewer__generateLink( $type, $title, $html, &$link ); |
| 30 | } |